gcc/libstdc++-v3/include/std/chrono

696 lines
21 KiB
Plaintext
Raw Normal View History

chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// <chrono> -*- C++ -*-
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
/** @file include/chrono
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_CHRONO
#define _GLIBCXX_CHRONO 1
#pragma GCC system_header
#ifndef __GXX_EXPERIMENTAL_CXX0X__
# include <c++0x_warning.h>
#else
#ifdef _GLIBCXX_INCLUDE_AS_TR1
# error C++0x header cannot be included from TR1 header
#endif
#include <ratio>
#include <type_traits>
#include <limits>
#include <ctime>
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
namespace std
{
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/**
* @defgroup chrono Time
* @ingroup utilities
*
* Classes and functions for time.
* @{
*/
/** @namespace std::chrono
* @brief ISO C++ 0x entities sub namespace for time and date.
*/
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
namespace chrono
{
template<typename _Rep, typename _Period = ratio<1>>
struct duration;
template<typename _Clock, typename _Duration = typename _Clock::duration>
struct time_point;
}
// 20.8.2.3 specialization of common_type (for duration)
template<typename _Rep1, typename _Period1, typename _Rep2, typename _Period2>
struct common_type<chrono::duration<_Rep1, _Period1>,
chrono::duration<_Rep2, _Period2>>
{
typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
ratio<__static_gcd<_Period1::num, _Period2::num>::value,
(_Period1::den / __static_gcd<_Period1::den, _Period2::den>::value)
* _Period2::den>> type;
};
// 20.8.2.3 specialization of common_type (for time_point)
template<typename _Clock, typename _Duration1, typename _Duration2>
struct common_type<chrono::time_point<_Clock, _Duration1>,
chrono::time_point<_Clock, _Duration2>>
{
typedef chrono::time_point<_Clock,
typename common_type<_Duration1, _Duration2>::type> type;
};
namespace chrono
{
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
// Primary template for duration_cast impl.
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _ToDuration, typename _CF, typename _CR,
bool _NumIsOne = false, bool _DenIsOne = false>
struct __duration_cast_impl
{
template<typename _Rep, typename _Period>
static _ToDuration __cast(const duration<_Rep, _Period>& __d)
{
return _ToDuration(static_cast<
typename _ToDuration::rep>(static_cast<_CR>(__d.count())
* static_cast<_CR>(_CF::num)
/ static_cast<_CR>(_CF::den)));
}
};
template<typename _ToDuration, typename _CF, typename _CR>
struct __duration_cast_impl<_ToDuration, _CF, _CR, true, true>
{
template<typename _Rep, typename _Period>
static _ToDuration __cast(const duration<_Rep, _Period>& __d)
{
return _ToDuration(
static_cast<typename _ToDuration::rep>(__d.count()));
}
};
template<typename _ToDuration, typename _CF, typename _CR>
struct __duration_cast_impl<_ToDuration, _CF, _CR, true, false>
{
template<typename _Rep, typename _Period>
static _ToDuration __cast(const duration<_Rep, _Period>& __d)
{
return _ToDuration(static_cast<typename _ToDuration::rep>(
static_cast<_CR>(__d.count()) / static_cast<_CR>(_CF::den)));
}
};
template<typename _ToDuration, typename _CF, typename _CR>
struct __duration_cast_impl<_ToDuration, _CF, _CR, false, true>
{
template<typename _Rep, typename _Period>
static _ToDuration __cast(const duration<_Rep, _Period>& __d)
{
return _ToDuration(static_cast<typename _ToDuration::rep>(
static_cast<_CR>(__d.count()) * static_cast<_CR>(_CF::num)));
}
};
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// duration_cast
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _ToDuration, typename _Rep, typename _Period>
inline _ToDuration
duration_cast(const duration<_Rep, _Period>& __d)
{
typedef typename
ratio_divide<_Period, typename _ToDuration::period>::type __cf;
typedef typename
common_type<typename _ToDuration::rep, _Rep, intmax_t>::type __cr;
return __duration_cast_impl<_ToDuration, __cf, __cr,
__cf::num == 1, __cf::den == 1>::__cast(__d);
}
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// treat_as_floating_point
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Rep>
struct treat_as_floating_point
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
: is_floating_point<_Rep>
{ };
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// duration_values
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Rep>
struct duration_values
{
static const _Rep
zero()
{ return _Rep(0); }
static const _Rep
max()
{ return numeric_limits<_Rep>::max(); }
static const _Rep
min()
{ return numeric_limits<_Rep>::min(); }
};
template<typename _Tp>
struct __is_duration
: std::false_type
{ };
template<typename _Rep, typename _Period>
struct __is_duration<duration<_Rep, _Period>>
: std::true_type
{ };
template<typename T>
struct __is_ratio
: std::false_type
{ };
template<intmax_t _Num, intmax_t _Den>
struct __is_ratio<ratio<_Num, _Den>>
: std::true_type
{ };
/// duration
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Rep, typename _Period>
struct duration
{
static_assert(!__is_duration<_Rep>::value, "rep cannot be a duration");
static_assert(__is_ratio<_Period>::value,
"period must be a specialization of ratio");
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
static_assert(_Period::num > 0, "period must be positive");
typedef _Rep rep;
typedef _Period period;
// 20.8.3.1 construction / copy / destroy
duration() = default;
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Rep2>
explicit duration(const _Rep2& __rep)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
: __r(static_cast<rep>(__rep))
{
static_assert(is_convertible<_Rep2,rep>::value
&& (treat_as_floating_point<rep>::value
|| !treat_as_floating_point<_Rep2>::value),
"cannot construct integral duration with floating point type");
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
}
template<typename _Rep2, typename _Period2>
duration(const duration<_Rep2, _Period2>& __d)
: __r(duration_cast<duration>(__d).count())
{
static_assert(treat_as_floating_point<rep>::value == true
|| (ratio_divide<_Period2, period>::type::den == 1
&& !treat_as_floating_point<_Rep2>::value),
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
"the resulting duration is not exactly representable");
}
~duration() = default;
duration(const duration&) = default;
duration& operator=(const duration&) = default;
// 20.8.3.2 observer
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
rep
count() const
{ return __r; }
// 20.8.3.3 arithmetic
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
duration
operator+() const
{ return *this; }
duration
operator-() const
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{ return duration(-__r); }
duration&
operator++()
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{
++__r;
return *this;
}
duration
operator++(int)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{ return duration(__r++); }
duration&
operator--()
{
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
--__r;
return *this;
}
duration
operator--(int)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{ return duration(__r--); }
duration&
operator+=(const duration& __d)
{
__r += __d.count();
return *this;
}
duration&
operator-=(const duration& __d)
{
__r -= __d.count();
return *this;
}
duration&
operator*=(const rep& __rhs)
{
__r *= __rhs;
return *this;
}
duration&
operator/=(const rep& __rhs)
{
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
__r /= __rhs;
return *this;
}
// DR 934.
template<typename _Rep2 = rep>
typename enable_if<!treat_as_floating_point<_Rep2>::value,
duration&>::type
operator%=(const rep& __rhs)
{
__r %= __rhs;
return *this;
}
template<typename _Rep2 = rep>
typename enable_if<!treat_as_floating_point<_Rep2>::value,
duration&>::type
operator%=(const duration& __d)
{
__r %= __d.count();
return *this;
}
// 20.8.3.4 special values
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// TODO: These should be constexprs.
static const duration
zero()
{ return duration(duration_values<rep>::zero()); }
static const duration
min()
{ return duration(duration_values<rep>::min()); }
static const duration
max()
{ return duration(duration_values<rep>::max()); }
private:
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
rep __r;
};
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type
operator+(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{
typedef typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type __ct;
return __ct(__lhs) += __rhs;
}
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type
operator-(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{
typedef typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type __ct;
return __ct(__lhs) -= __rhs;
}
template<typename _Rep1, typename _Period, typename _Rep2>
inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
typedef typename common_type<_Rep1, _Rep2>::type __cr;
return duration<__cr, _Period>(__d) *= __s;
}
template<typename _Rep1, typename _Period, typename _Rep2>
inline duration<typename common_type<_Rep1, _Rep2>::type, _Period>
operator*(const _Rep2& __s, const duration<_Rep1, _Period>& __d)
{ return __d * __s; }
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Rep1, typename _Period, typename _Rep2>
inline duration<typename common_type<_Rep1, typename
enable_if<!__is_duration<_Rep2>::value, _Rep2>::type>::type, _Period>
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{
typedef typename common_type<_Rep1, _Rep2>::type __cr;
return duration<__cr, _Period>(__d) /= __s;
}
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline typename common_type<_Rep1, _Rep2>::type
operator/(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{
typedef typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type __ct;
return __ct(__lhs).count() / __ct(__rhs).count();
}
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// DR 934.
template<typename _Rep1, typename _Period, typename _Rep2>
inline duration<typename common_type<_Rep1, typename
enable_if<!__is_duration<_Rep2>::value, _Rep2>::type>::type, _Period>
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{
typedef typename common_type<_Rep1, _Rep2>::type __cr;
return duration<__cr, _Period>(__d) %= __s;
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
}
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type
operator%(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{
typedef typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type __ct;
return __ct(__lhs) %= __rhs;
}
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// comparisons
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline bool
operator==(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{
typedef typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type __ct;
return __ct(__lhs).count() == __ct(__rhs).count();
}
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline bool
operator<(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{
typedef typename common_type<duration<_Rep1, _Period1>,
duration<_Rep2, _Period2>>::type __ct;
return __ct(__lhs).count() < __ct(__rhs).count();
}
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline bool
operator!=(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{ return !(__lhs == __rhs); }
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline bool
operator<=(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{ return !(__rhs < __lhs); }
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline bool
operator>(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{ return __rhs < __lhs; }
template<typename _Rep1, typename _Period1,
typename _Rep2, typename _Period2>
inline bool
operator>=(const duration<_Rep1, _Period1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{ return !(__lhs < __rhs); }
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// nanoseconds
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef duration<int64_t, nano> nanoseconds;
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// microseconds
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef duration<int64_t, micro> microseconds;
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// milliseconds
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef duration<int64_t, milli> milliseconds;
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// seconds
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef duration<int64_t > seconds;
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// minutes
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef duration<int, ratio< 60>> minutes;
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// hours
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef duration<int, ratio<3600>> hours;
/// time_point
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _Clock, typename _Duration>
struct time_point
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
{
typedef _Clock clock;
typedef _Duration duration;
typedef typename duration::rep rep;
typedef typename duration::period period;
time_point() : __d(duration::zero())
{ }
explicit time_point(const duration& __dur)
: __d(duration::zero() + __dur)
{ }
// conversions
template<typename _Duration2>
time_point(const time_point<clock, _Duration2>& __t)
: __d(__t.time_since_epoch())
{ }
// observer
duration
time_since_epoch() const
{ return __d; }
// arithmetic
time_point&
operator+=(const duration& __dur)
{
__d += __dur;
return *this;
}
time_point&
operator-=(const duration& __dur)
{
__d -= __dur;
return *this;
}
// special values
// TODO: These should be constexprs.
static const time_point
min()
{ return time_point(duration::min()); }
static const time_point
max()
{ return time_point(duration::max()); }
private:
duration __d;
};
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// time_point_cast
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
template<typename _ToDuration, typename _Clock, typename _Duration>
inline time_point<_Clock, _ToDuration>
time_point_cast(const time_point<_Clock, _Duration>& __t)
{
return time_point<_Clock, _ToDuration>(
duration_cast<_ToDuration>(__t.time_since_epoch()));
}
template<typename _Clock, typename _Duration1,
typename _Rep2, typename _Period2>
inline time_point<_Clock,
typename common_type<_Duration1, duration<_Rep2, _Period2>>::type>
operator+(const time_point<_Clock, _Duration1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{
typedef time_point<_Clock,
typename common_type<_Duration1,
duration<_Rep2, _Period2>>::type> __ct;
return __ct(__lhs) += __rhs;
}
template<typename _Rep1, typename _Period1,
typename _Clock, typename _Duration2>
inline time_point<_Clock,
typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
operator+(const duration<_Rep1, _Period1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return __rhs + __lhs; }
template<typename _Clock, typename _Duration1,
typename _Rep2, typename _Period2>
inline time_point<_Clock,
typename common_type<_Duration1, duration<_Rep2, _Period2>>::type>
operator-(const time_point<_Clock, _Duration1>& __lhs,
const duration<_Rep2, _Period2>& __rhs)
{ return __lhs + (-__rhs); }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline typename common_type<_Duration1, _Duration2>::type
operator-(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return __lhs.time_since_epoch() - __rhs.time_since_epoch(); }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline bool
operator==(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return __lhs.time_since_epoch() == __rhs.time_since_epoch(); }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline bool
operator!=(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return !(__lhs == __rhs); }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline bool
operator<(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return __lhs.time_since_epoch() < __rhs.time_since_epoch(); }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline bool
operator<=(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return !(__rhs < __lhs); }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline bool
operator>(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return __rhs < __lhs; }
template<typename _Clock, typename _Duration1, typename _Duration2>
inline bool
operator>=(const time_point<_Clock, _Duration1>& __lhs,
const time_point<_Clock, _Duration2>& __rhs)
{ return !(__lhs < __rhs); }
/// system_clock
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
struct system_clock
{
#ifdef _GLIBCXX_USE_CLOCK_REALTIME
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef chrono::nanoseconds duration;
#elif defined(_GLIBCXX_USE_GETTIMEOFDAY)
typedef chrono::microseconds duration;
#else
typedef chrono::seconds duration;
#endif
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<system_clock, duration> time_point;
static const bool is_monotonic = false;
static time_point
condition_variable.cc (condition_variable, [...]): Mark throw() * src/condition_variable.cc (condition_variable, condition_variable_any constructors): Mark throw() * src/hash.cc (operator() for long double, string, and wstring): Mark throw (). * src/strstream.cc (strstreambuf constructors, freeze, str, pcount, _M_setup, rdbuf, str): Mark throw (). * src/chrono.cc (new): Mark throw (). * include/std/system_error (system_category, generic_category): Mark throw () and const. * include/std/chrono (now): Mark throw (). * include/std/condition_variable (condition_variable, ~condition_variable, condition_variable_any, ~condition_variable_any): Mark throw (). * include/std/mutex (mutex): Mark throw (). * include/bits/stl_list.h (swap, transfer, reverse, hook, unhook): Mark throw. * include/bits/functional_hash.h (operator() on size_t): Mark pure and throw (). * include/bits/locale_facets.tcc (__verify_grouping): Mark pure. * include/bits/locale_classes.h (_S_initialize_once, _S_clone_c_locale): Mark throw (). (_S_get_c_name): Mark const and throw (). (_M_id, _M_compare, _M_transform, _M_compare, _M_transform): Mark throw (). * include/bits/locale_facets.h (__convert_to_v explicit instances): Mark throw (). (_M_convert_to_wmask, _M_initialize_ctype, _S_format_float): Mark throw (). * include/bits/ios_base.h (_M_dispose_callbacks, _M_init, imbue, ios_base): Mark throw () * include/bits/locale_facets_nonio.h (_M_put): Mark throw. * include/backward/strstream (strstreambuf constructors): Mark throw (). (str, freeze, _M_setupf): Mark throw (). (pcount): Mark pure and throw (). (rdbuf): Mark const and throw (). From-SVN: r146328
2009-04-18 23:19:18 +02:00
now() throw ();
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
// Map to C API
static std::time_t
to_time_t(const time_point& __t)
{
return std::time_t(
duration_cast<chrono::seconds>(__t.time_since_epoch()).count());
}
static time_point
from_time_t(std::time_t __t)
{
return time_point_cast<system_clock::duration>(
chrono::time_point<system_clock, chrono::seconds>(
chrono::seconds(__t)));
}
// TODO: requires constexpr
/*
static_assert(
system_clock::duration::min() <
system_clock::duration::zero(),
"a clock's minimum duration cannot be less than its epoch");
*/
};
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
/// monotonic_clock
struct monotonic_clock
{
typedef chrono::nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
typedef chrono::time_point<monotonic_clock, duration> time_point;
static const bool is_monotonic = true;
static time_point
now();
};
#else
typedef system_clock monotonic_clock;
#endif
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
typedef system_clock high_resolution_clock;
user.cfg.in: Tweaks. 2009-02-20 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Tweaks. * doc/doxygen/doxygroups.cc: Prefer markup that can be elsewhere, be elsewhere. * include/tr1_impl/unordered_map: Just use most specialized container module. * include/tr1_impl/unordered_set: Same. * include/tr1_impl/array: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_queue.h: Same. * include/bits/stl_set.h: Same. * include/bits/stl_stack.h: Same. * include/bits/forward_list.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_bvector.h: Same. * include/backward/binders.h: Change binder module to binders. * include/std/complex: Add complex_numers module. * include/tr1_impl/complex: Same. * include/std/valarray: Add numeric_arrays module. * include/bits/gslice_array.h: Same. * include/bits/gslice.h: Same. * include/bits/mask_array.h: Same. * include/bits/slice_array.h: Same. * include/bits/indirect_array.h: Same. * include/bits/allocator.h: Add allocators module. * include/ext/throw_allocator.h * include/ext/pool_allocator.h * include/ext/bitmap_allocator.h * include/ext/new_allocator.h * include/ext/malloc_allocator.h * include/ext/array_allocator.h * include/ext/mt_allocator.h * include/ext/debug_allocator.h * include/ext/extptr_allocator.h * include/tr1_impl/functional: Move namespace markup here. * include/tr1_impl/regex: Same. * include/tr1_impl/type_traits: Add metaprogramming module. * include/std/type_traits: Same. * include/std/memory: Add memory module. * include/std/ratio: Add ratio module. * include/std/chrono: Move namespace markup here, add time module. * include/std/thread: Move namespace markup here, add concurrency module. * include/std/mutex: Use concurrency module. * include/std/condition_variable: Same. * include/bits/ios_base.h: Refine io module. * include/bits/basic_ios.h: Same. * include/std/fstream: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/sstream: Same. * include/ext/vstring.h: Correct parameter markup. * include/bits/shared_ptr.h: Add pointer_abstractions module. * include/bits/unique_ptr.h: Same. * include/bits/algorithmfwd.h: Add mutating_algorithms, non_mutating_algorithms, sorting_algorithms. Adjust nesting. * include/bits/stl_heap.h: Add markup for new groupings. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/c_compatibility/stdatomic.h: Add atomics module. * include/c_global/cstdatomic: Same. * libsupc++/exception: Add exceptions module. * libsupc++/typeinfo: Same. * libsupc++/new: Same. * libsupc++/exception_ptr.h: Same. * include/std/system_error: Same. * include/std/stdexcept: Same. * libsupc++/cxxabi.h: Move doxygroups.cc markup here. * libsupc++/cxxabi-forced.h: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Fix up line numbers. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable_any/cons/copy_neg.cc: Same. * testsuite/30_threads/mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/thread/cons/assign_neg.cc: Same. * testsuite/30_threads/thread/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/assign_neg.cc: Same. * testsuite/30_threads/condition_variable/cons/copy_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc: Same. * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/ constructor_2_neg.cc: Same. * testsuite/20_util/duration/cons/1_neg.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/unique_ptr/modifiers/reset_neg.cc: Same. * testsuite/20_util/unique_ptr/assign/assign.cc: Same. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Same. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow.cc: Same. * testsuite/20_util/ratio/operations/ops_overflow.cc: Same. From-SVN: r144343
2009-02-21 01:45:21 +01:00
} // namespace chrono
// @} group chrono
} // namespace std
chrono: New, as per N2661. 2008-07-15 Chris Fairles <chris.fairles@gmail.com> * include/std/chrono: New, as per N2661. * src/chrono.cc: New. * include/Makefile.am: Update. * src/Makefile.am: Likewise. * include/Makefile.in: Regenerate. * src/Makefile.in: Likewise. * acinclude.m4: Add tests for clock_gettime and gettimeofday that define _GLIBCXX_HAS_CLOCK_GETTIME and/or _GLIBCXX_HAS_GETTIMEOFDAY. * configure.ac: Use them. * configure: Regenerate. * config.h.in: Likewise. * config/abi/pre/gnu.ver: Add symbols for system_clock::now() and system_clock::is_monotonic. * testsuite/20_util/duration/cons/1.cc: New. * testsuite/20_util/duration/cons/2.cc: Likewise. * testsuite/20_util/duration/cons/1_neg.cc: Likewise. * testsuite/20_util/duration/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/duration/arithmetic/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/2.cc: Likewise. * testsuite/20_util/duration/comparisons/1.cc: Likewise. * testsuite/20_util/time_point/requirements/explicit_instantiation/ explicit_instantiation.cc: Likewise. * testsuite/20_util/time_point/1.cc: Likewise. * testsuite/20_util/time_point/2.cc: Likewise. * testsuite/20_util/time_point/3.cc: Likewise. * testsuite/20_util/clocks/1.cc: Likewise. * testsuite/17_intro/headers/c++200x/all_multiple_inclusion.cc: Add missing headers. * testsuite/17_intro/headers/c++200x/all.cc: Likewise. * include/precompiled/stdc++.h: Likewise and remove <date_time>. * doc/doxygen/user.cfg.in: Likewise. From-SVN: r137858
2008-07-16 01:23:23 +02:00
#endif //_GLIBCXX_USE_C99_STDINT_TR1
#endif //__GXX_EXPERIMENTAL_CXX0X__
#endif //_GLIBCXX_CHRONO