From b4a784aa9a0bcb65c77d7cf0bd65e4da26425a4c Mon Sep 17 00:00:00 2001
From: Geoffrey Keating
Date: Sat, 9 Apr 2005 06:13:35 +0000
Subject: Merge to tag apple-local-merge-20050406.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@97889 138bc75d-0d04-0410-961f-82ee72b054a4
---
libstdc++-v3/ChangeLog | 509 ++++++
libstdc++-v3/acconfig.h | 2 +-
libstdc++-v3/acinclude.m4 | 2 +-
libstdc++-v3/config.h.in | 2 +-
libstdc++-v3/config/cpu/cris/atomicity.h | 10 +-
libstdc++-v3/config/cpu/s390/atomicity.h | 3 +-
libstdc++-v3/config/linker-map.gnu | 6 +
libstdc++-v3/configure | 2 +-
libstdc++-v3/docs/doxygen/user.cfg.in | 10 +-
libstdc++-v3/docs/html/ext/howto.html | 6 +
libstdc++-v3/docs/html/faq/index.html | 3 +
libstdc++-v3/include/Makefile.am | 15 +-
libstdc++-v3/include/Makefile.in | 15 +-
libstdc++-v3/include/bits/basic_string.tcc | 6 +-
libstdc++-v3/include/bits/c++config | 2 +-
libstdc++-v3/include/bits/stl_algobase.h | 9 +-
libstdc++-v3/include/std/std_complex.h | 36 +-
libstdc++-v3/include/std/std_fstream.h | 12 +
libstdc++-v3/include/tr1/functional | 1103 ++++++++++++-
libstdc++-v3/include/tr1/tuple | 1654 +++-----------------
libstdc++-v3/include/tr1/tuple_iterate.h | 26 +-
libstdc++-v3/include/tr1/type_traits | 429 ++---
libstdc++-v3/include/tr1/type_traits_fwd.h | 13 +
libstdc++-v3/include/tr1/utility | 9 +
libstdc++-v3/libsupc++/eh_alloc.cc | 6 +
libstdc++-v3/libsupc++/eh_catch.cc | 23 +-
libstdc++-v3/libsupc++/eh_throw.cc | 5 +-
libstdc++-v3/libsupc++/unwind-cxx.h | 1 +
libstdc++-v3/scripts/check_performance | 38 +-
.../21_strings/basic_string/find/char/3.cc | 4 +-
.../21_strings/basic_string/find/wchar_t/3.cc | 4 +-
.../22_locale/collate/compare/wchar_t/2.cc | 1 +
.../collate/compare/wchar_t/wrapped_env.cc | 1 +
.../collate/compare/wchar_t/wrapped_locale.cc | 1 +
.../testsuite/22_locale/collate/hash/wchar_t/2.cc | 1 +
.../22_locale/collate/hash/wchar_t/wrapped_env.cc | 1 +
.../collate/hash/wchar_t/wrapped_locale.cc | 1 +
.../22_locale/collate/transform/wchar_t/2.cc | 1 +
.../collate/transform/wchar_t/wrapped_env.cc | 1 +
.../collate/transform/wchar_t/wrapped_locale.cc | 1 +
.../testsuite/23_containers/set/modifiers/16728.cc | 3 +-
.../testsuite/27_io/basic_ifstream/open/char/1.cc | 9 +-
.../testsuite/27_io/basic_ofstream/open/char/1.cc | 9 +-
.../basic_ostream/inserters_other/wchar_t/2.cc | 4 +-
libstdc++-v3/testsuite/testsuite_abi.cc | 1 +
libstdc++-v3/testsuite/testsuite_tr1.h | 94 +-
libstdc++-v3/testsuite/thread/pthread1.cc | 2 +-
libstdc++-v3/testsuite/thread/pthread2.cc | 2 +-
libstdc++-v3/testsuite/thread/pthread3.cc | 2 +-
libstdc++-v3/testsuite/thread/pthread4.cc | 2 +-
libstdc++-v3/testsuite/thread/pthread5.cc | 2 +-
libstdc++-v3/testsuite/thread/pthread6.cc | 2 +-
libstdc++-v3/testsuite/thread/pthread7-rope.cc | 2 +-
.../is_function/is_function.cc | 1 +
54 files changed, 2309 insertions(+), 1800 deletions(-)
(limited to 'libstdc++-v3')
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0d5155bc367..0e948f11e30 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,512 @@
+2005-04-06 Ulrich Weigand
+
+ * config/cpu/s390/atomicity.h (__exchange_and_add): Add "memory"
+ clobber to inline assembly statement.
+
+2005-04-05 Jonathan Wakely
+
+ * include/tr1/memory, include/tr1/boost_shared_ptr.h: Use mutex
+ to make _Sp_counted_base::add_ref_lock() thread-safe. Check whether
+ to destroy resources by testing for equality, not inequality. Add
+ empty critical sections to solve memory visibility issues.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/auto_ptr_neg.cc: Use dg-excess-errors instead of
+ explicitly listing line numbers which need to be kept in sync.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr_neg.cc: Same.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr_rvalue_neg.cc: Same.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/weak_ptr_expired.cc: Make XFAIL for consistency when
+ -fno-exceptions.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared.cc: Add explanatory comments.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared2.cc: Same.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared3.cc: Same.
+
+2005-04-02 Douglas Gregor
+
+ * include/tr1/tuple_iterate.h (tuple_element): Use new macro
+ _GLIBCXX_T_NUM_ARGS_PLUS_1 because _T is a macro on Darwin.
+ * include/tr1/repeat.h (_GLIBCXX_T_NUM_ARGS_PLUS_1): Define for
+ each iteration.
+ * scripts/gen_includers.h: Define _GLIBCXX_T_NUM_ARGS_PLUS_1 for
+ each iteration.
+
+2005-04-01 Douglas Gregor
+
+ * include/tr1/functional (_Maybe_wrap_member_pointer): Wrap up
+ member pointers in _Mem_fn but let other function objects pass
+ through unchanged.
+ * include/tr1/functional_iterator (bind): Reduce number of bind()
+ overloads to two to eliminate ambiguities. Use
+ _Maybe_wrap_member_pointer to handle member pointers gracefully.
+
+2005-03-31 Chris Jefferson
+
+ * include/tr1/tuple: Support iteration via tuple_iterate.h.
+ * include/tr1/tuple_iterate.h: Iteration file for tuple.
+
+2005-03-31 Douglas Gregor
+
+ * include/Makefile.am (tr1_headers): Add bind and mu repetition
+ headers and reference_wrapper<> forwarding header.
+ * include/Makefile.in: Regenerate.
+ * include/tr1/bind_iterate.h: Implementation of function call
+ operators for the function object returned from tr1::bind().
+ * include/tr1/bind_repeat.h: Bind-specific repetition header,
+ akin to include/tr1/repeat.h.
+ * include/tr1/functional (_Mem_fn): Bug fix: declare result member
+ template for use with result_of.
+ (is_bind_expression): New.
+ (is_placeholder): New.
+ (_Placeholder): New. Placeholder type for bind.
+ (_Mu): New. Implementation detail of bind.
+ (_Bind, _Bind_result): New. Function objects returned by bind.
+ (_GLIBCXX_JOIN): New. Required to create bind placeholders.
+ * include/tr1/functional_iterate.h (_Bind, _Bind_result, bind):
+ New. Implementation of tr1::bind.
+ * include/tr1/mu_iterate.h (_Mu): result template and operator()
+ for the _Mu helper to bind.
+ * include/tr1/ref_fwd.h (reference_wrapper): Forward declaration
+ used by tuple header.
+ (ref): Ditto.
+ (cref): Ditto.
+ * include/tr1/repeat.h: Add bind-specific repetition macros.
+ * include/tr1/tuple: Use reference_wrapper forwarding header for
+ initial definitions, then include at the end, to
+ make the circular dependencies work.
+ (tie): Support zero-argument tie() function.
+ * testsuite/tr1/3_function_objects/bind/all_bound.cc: New test of
+ bind() functionality with parameters bound.
+ * testsuite/tr1/3_function_objects/bind/nested.cc: New test of
+ nested bind() expressions.
+ * testsuite/tr1/3_function_objects/bind/placeholders.cc: New test
+ of bind() placeholders.
+ * testsuite/tr1/3_function_objects/bind/ref.cc: New test of bind()
+ with arguments bound via reference_wrapper<>.
+ * scripts/gen_includers.pl: Generate the repetitive part of
+ include/tr1/repeat.h.
+ * scripts/gen_bind_includers.pl: Generate the repetitive part of
+ include/tr1/bind_repeat.h.
+
+2005-03-24 Benjamin Kosnik
+
+ * include/tr1/memory: Forward to...
+ * include/tr1/boost_shared_ptr.h: ...here. Add Boost Software License.
+ * include/Makefile.am (tr1_headers): Add boost_shared_ptr.h.
+ * include/Makefile.in: Regenerate.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/
+ auto_ptr_neg.cc: Adjust line numbers.
+
+2005-03-22 Chris Jefferson
+
+ PR libstdc++/20577
+ * include/bits/stl_algobase.h (iter_swap): Only delegate iter_swap
+ to swap when the iterator's reference_type is a reference to its
+ value_type.
+ * testsuite/25_algorithms/iter_swap/20577.cc: New.
+
+2005-03-21 Paolo Carlini
+
+ PR libstdc++/20352
+ * include/std/std_complex.h (pow(const complex<_Tp>&,
+ const _Tp&)): On non-c99 platforms, don't try to compute
+ log of complex zero.
+
+2005-03-17 Benjamin Kosnik
+
+ * testsuite/testsuite_abi.cc: Add CXXABI_1.3.1.
+
+2005-03-08 Paolo Carlini
+
+ * include/tr1/type_traits (is_polymorphic): Don't forget
+ the virtual destructor, thus avoiding warnings.
+ * testsuite/testsuite_tr1.h (class AbstractClass,
+ class PolymorphicClass): Likewise.
+
+2005-03-08 Paolo Carlini
+
+ * include/std/std_complex.h (pow(const complex<_Tp>&,
+ const complex<_Tp>&)): Dispatch to either __complex_pow(__x.__rep(),
+ __y.__rep()) or __complex_pow(__x, __y) depending on the macro
+ _GLIBCXX_USE_C99_COMPLEX.
+
+2005-03-08 Paolo Carlini
+
+ * include/std/std_fstream.h (basic_fstream<>::open,
+ basic_ifstream<>::open, basic_ofstream<>::open): Implement the
+ resolution of DR 409 [Ready], call clear() on success.
+ * docs/html/ext/howto.html: Add an entry for DR 409.
+ * docs/html/faq/index.html (4_4): Clarify the new behavior.
+ * testsuite/27_io/basic_ifstream/open/char/1.cc: Adjust.
+ * testsuite/27_io/basic_ofstream/open/char/1.cc: Likewise.
+
+2005-03-06 Paolo Carlini
+
+ * include/tr1/type_traits: Add is_base_of.
+ * testsuite/tr1/4_metaprogramming/relationships_between_types/
+ is_base_of/is_base_of.cc: New.
+ * testsuite/tr1/4_metaprogramming/relationships_between_types/
+ is_base_of/typedefs.cc: Likewise.
+
+2005-03-05 Joseph S. Myers
+
+ * testsuite/22_locale/collate/compare/wchar_t/2.cc,
+ testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc,
+ testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc,
+ testsuite/22_locale/collate/hash/wchar_t/2.cc,
+ testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc,
+ testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc,
+ testsuite/22_locale/collate/transform/wchar_t/2.cc,
+ testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc,
+ testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
+ XFAIL on *-*-hpux11.23.
+
+2005-03-04 Paolo Carlini
+
+ * include/tr1/type_traits: Implement is_polymorphic.
+ (is_empty): Minor tweaks.
+ * testsuite/testsuite_tr1.h: Add test types.
+ * testsuite/tr1/4_metaprogramming/type_properties/
+ is_polymorphic/is_polymorphic.cc: New.
+ * testsuite/tr1/4_metaprogramming/type_properties/
+ is_polymorphic/typedefs.cc: Likewise.
+ * testsuite/tr1/4_metaprogramming/composite_type_traits/
+ is_union_or_class/is_union_or_class.cc: Add tests.
+
+2005-03-03 Benjamin Kosnik
+
+ * include/tr1/functional: Convert relative path.
+
+ * docs/doxygen/user.cfg.in: Add tr1 includes.
+
+2005-03-02 Jonathan Wakely
+ Benjamin Kosnik
+
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/
+ cons/auto_ptr_neg.cc: Correct line numbers.
+
+2005-03-02 Jonathan Wakely
+
+ * include/tr1/memory: Replace checked_deleter with (unchecked)
+ _Sp_deleter as GCC warns about delete on incomplete types anyway.
+
+2005-03-02 Jonathan Wakely
+
+ * include/tr1/memory: Add missing "inline" to __throw_bad_weak_ptr.
+
+2005-03-02 Douglas Gregor
+
+ * include/tr1/functional (_Has_result_type): Cleanup.
+ (_Result_of_impl): Handle member data pointers correctly.
+ (reference_wrapper): Support invocation.
+ Move repetition code into new file include/tr1/repeat.h.
+ * include/tr1/functional_iterate.h (reference_wrapper): Support
+ invocation. Cleanup long lines.
+ * include/tr1/ref_wrap_iterate.h (reference_wrapper): Declare
+ invocation operators.
+ * include/tr1/repeat.h: Code repetition header.
+ * include/Makefile.am: Add ref_wrap_iterate.h, repeat.h.
+ * include/Makefile.in: Add ref_wrap_iterate.h, repeat.h.
+ * testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc:
+ New test of reference_wrapper invocation.
+ * testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc:
+ New test of reference_wrapper typedefs and base classes.
+ * testsuite/tr1/3_function_objects/result_of.cc: Trivial cleanup
+ (e-mail address).
+
+2005-03-02 Douglas Gregor
+
+ * include/tr1/function (result_of): New class template.
+ * include/tr1/functional/iterator.h: Implementation of TR1
+ result_of.
+ * testsuite/tr1/3_function_objects/result_of.cc: New test
+
+2005-03-01 Hans-Peter Nilsson
+
+ PR target/19065
+ * config/cpu/cris/atomicity.h (__exchange_and_add): In asm, use
+ 'Q' constraint, not 'm'.
+
+2005-02-25 Paolo Carlini
+
+ * include/tr1/type_traits: Add the trivial is_union and is_class;
+ add the __is_union_or_class extension.
+ (is_enum, is_empty): Use the latter.
+ * include/tr1/type_traits_fwd.h: Add __is_union_or_class.
+ * testsuite/testsuite_tr1.h: Add UnionType; trivial formatting
+ fixes.
+ * testsuite/tr1/4_metaprogramming/composite_type_traits/
+ is_union_or_class/is_union_or_class.cc: New.
+ * testsuite/tr1/4_metaprogramming/composite_type_traits/
+ is_union_or_class/typedefs.cc: Likewise.
+
+2005-02-24 Benjamin Kosnik
+
+ * testsuite/tr1/6_containers/unordered/instantiate/hash.cc: Guard
+ wchar_t use with _GLIBCXX_USE_WCHAR_T.
+
+2005-02-24 Benjamin Kosnik
+
+ * include/std/std_complex.h: _GLIBCXX_USE_C99_COMPLEX_MATH to
+ _GLIBCXX_USE_C99_COMPLEX.
+ * acinclude.m4: Same.
+ * acconfig.h: Same.
+ * configure: Regenerate.
+ * config.h.in: Same.
+
+2005-02-24 Paolo Carlini
+
+ * include/tr1/functional (mem_fn): Avoid _T, badname on
+ Darwin.
+
+2005-02-23 Douglas Gregor
+
+ * include/tr1/functional (function): New class template.
+ (mem_fn): New function template.
+ Implementations of TR1 function and mem_fn facilities.
+ * include/tr1/functional_iterate.h: Implementations of TR1
+ function and mem_fn facilities.
+ * testsuite/tr1/3_function_objects/function/1.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/2.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/3.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/4.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/5.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/6.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/7.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/8.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/function/9.cc: New
+ test of std::tr1::function.
+ * testsuite/tr1/3_function_objects/mem_fn.cc: New test of
+ std::tr1::mem_fn.
+
+2005-02-23 Paolo Carlini
+
+ * include/tr1/type_traits: Implement is_convertible.
+ * testsuite/tr1/4_metaprogramming/relationships_between_types/
+ is_convertible/is_convertible.cc: New.
+ * testsuite/tr1/4_metaprogramming/relationships_between_types/
+ is_convertible/typedefs.cc: Likewise.
+ * testsuite/testsuite_tr1.h: Add class DerivedType.
+
+ * include/tr1/type_traits (is_function): Don't mistake references
+ to function types for function types.
+ * testsuite/tr1/4_metaprogramming/primary_type_categories/
+ is_function/is_function.cc: Add testcase.
+
+2005-02-22 Benjamin Kosnik
+
+ * scripts/check_performance: Tweaks.
+
+ * testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc: Name
+ output file with extension that clean rules can find.
+
+2005-02-22 Richard Henderson
+
+ PR libstdc++/20091
+ * libsupc++/eh_catch.cc (__cxa_begin_catch): Don't special case
+ decrement of uncaughtExceptions for rethrow.
+
+2005-02-22 Paolo Carlini
+
+ * include/tr1/functional: Fix License to GPL with exception.
+ * include/tr1/hashtable: Likewise.
+ * include/tr1/tuple: Likewise.
+ * include/tr1/type_traits: Likewise.
+ * include/tr1/type_traits_fwd.h: Likewise.
+ * include/tr1/unordered_map: Likewise.
+ * include/tr1/unordered_set: Likewise.
+ * include/tr1/utility: Likewise.
+
+2005-02-22 Paolo Carlini
+
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/
+ auto_ptr_neg.cc: Add missing dg-do compile directive.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/
+ auto_ptr_rvalue_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/
+ shared_ptr_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/
+ auto_ptr_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
+ reset_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/
+ swap_neg.cc: Likewise.
+
+2005-02-22 Jonathan Wakely
+
+ * include/Makefile.am, include/Makefile.in: Fix accidental extra
+ change from previous commit.
+
+2005-02-21 Jonathan Wakely
+
+ * include/tr1/memory: New file.
+ * include/Makefile.am, include/Makefile.in: Add new TR1 header.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared2.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/not_shared3.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/shared.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ enable_shared_from_this/still_shared.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/assign.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/auto_ptr_rvalue_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/shared_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/assign/shared_ptr_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/comparison/cmp.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/auto_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/auto_ptr_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/copy.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/default.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/pointer.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/weak_ptr.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/cons/weak_ptr_expired.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/dest/dest.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/misc/io.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/misc/swap.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/reset.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/reset_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/swap.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/modifiers/swap_neg.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/bool_conv.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/get.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/unique.cc: New test.
+ * testsuite/tr1/2_general_utilities/memory/
+ shared_ptr/observers/use_count.cc: New test.
+
+2005-02-21 Paolo Carlini
+
+ * include/tr1/type_traits (is_member_function_pointer):
+ Remove ugly workaround for c++/19076.
+
+2005-02-21 Paolo Carlini
+
+ * include/bits/basic_string.tcc (_Rep::_M_destroy): Don't
+ check for this == &_S_empty_rep, it's always false, here.
+
+2005-02-19 Matt Austern
+
+ * include/tr1/functional (tr1_hashtable_define_trivial_hash): Make
+ hash::operator() a const member function for T a fundamental type
+ * include/tr1/hashtable (extract1st::operator()): Declare const.
+ (hash_code_base): Declare all member functions const
+ (hashtable::find): fix call to this->bucket_count()
+ (hashtable::count): Likewise.
+ (hashtable::equal_range): m_incr_bucket applies to iterator, not node.
+ * testsuite/tr1/6_containers/unordered/find/set1.cc: New test.
+ * testsuite/tr1/6_containers/unordered/find/map1.cc: New test.
+ * testsuite/tr1/6_containers/unordered/find/multimap1.cc: New test.
+ * testsuite/tr1/6_containers/unordered/find/multiset1.cc: New test.
+
+2005-02-19 Hans-Peter Nilsson
+
+ PR libstdc++/20071
+ * include/tr1/functional (hash): Wrap in #ifdef
+ _GLIBCXX_USE_WCHAR_T.
+
+2005-02-18 Richard Henderson
+
+ PR libstdc++/10606
+ * config/linker-map.gnu (CXXABI_1.3.1): Add __cxa_get_exception_ptr.
+ * libsupc++/eh_alloc.cc (__cxa_allocate_exception): Increment
+ uncaughtExceptions here instead of ...
+ * libsupc++/eh_throw.cc (__cxa_throw) ... here.
+ (__cxa_rethrow): Increment uncaughtExceptions here instead of ...
+ * libsupc++/eh_catch.cc (__cxa_end_catch): ... here.
+ (__cxa_get_exception_ptr): New.
+ * libsupc++/unwind-cxx.h (__cxa_get_exception_ptr): Declare.
+
+2005-02-18 Matt Austern
+
+ * testsuite/tr1/6_containers/unordered/insert/array_syntax.cc: Fix
+ test case to use assignment instead of ==
+ * testsuite/tr1/6_containers/unordered/insert/map_range.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multimap_range.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multiset_range.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/set_range.cc: New test.
+
+2005-02-18 Eric Botcazou
+
+ * testsuite/thread/pthread1.cc: Do not invoke pthread_setconcurrency
+ on Solaris 2.6 and below.
+ * testsuite/thread/pthread2.cc: Likewise.
+ * testsuite/thread/pthread3.cc: Likewise.
+ * testsuite/thread/pthread4.cc: Likewise.
+ * testsuite/thread/pthread5.cc: Likewise.
+ * testsuite/thread/pthread6.cc: Likewise.
+ * testsuite/thread/pthread7-rope.cc: Likewise.
+
+2005-02-17 Matt Austern
+
+ * include/tr1/functional (hash): New function object.
+ * include/tr1/hashtable: New file.
+ * include/tr1/unordered_set: New file.
+ * include/tr1/unordered_map: New file.
+ * include/Makefile.am: Add three new TR1 headers.
+ * include/Makefile.in: Likewise.
+ * testsuite/tr1/6_containers/unordered/insert/array_syntax.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/map_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multimap_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/multiset_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/insert/set_single.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/hash.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/map.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/multimap.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/multiset.cc: New test.
+ * testsuite/tr1/6_containers/unordered/instantiate/set.cc: New test.
+
+2005-02-16 Paolo Carlini
+
+ * testsuite/23_containers/set/modifiers/16728.cc:
+ Remove redundant include .
+
+2005-02-16 Paolo Carlini
+
+ PR libstdc++/19829
+ * testsuite/21_strings/basic_string/find/char/3.cc: Fix the test
+ at line #66 to not access str_lit01 beyond its end.
+ * testsuite/21_strings/basic_string/find/wchar_t/3.cc: Likewise.
+
2005-02-15 Paolo Carlini
Jon Grimm
diff --git a/libstdc++-v3/acconfig.h b/libstdc++-v3/acconfig.h
index f1b821630ba..51d588430a3 100644
--- a/libstdc++-v3/acconfig.h
+++ b/libstdc++-v3/acconfig.h
@@ -20,7 +20,7 @@
#undef _GLIBCXX_USE_C99_MATH
// Define if C99 complex math functions should be used in std::complex.
-#undef _GLIBCXX_USE_C99_COMPLEX_MATH
+#undef _GLIBCXX_USE_C99_COMPLEX
// Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index f18b7d90b53..4ef88ad4d55 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -983,7 +983,7 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
AC_MSG_RESULT($ac_c99_complex)
if test x"$ac_c99_complex" = x"yes"; then
- AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX_MATH)
+ AC_DEFINE(_GLIBCXX_USE_C99_COMPLEX)
fi
# Check for the existence in of vscanf, et. al.
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index fdcc07cb2a2..76d32d1630f 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -21,7 +21,7 @@
#undef _GLIBCXX_USE_C99_MATH
// Define if C99 complex math functions should be used in std::complex.
-#undef _GLIBCXX_USE_C99_COMPLEX_MATH
+#undef _GLIBCXX_USE_C99_COMPLEX
// Define if code specialized for wchar_t should be used.
#undef _GLIBCXX_USE_WCHAR_T
diff --git a/libstdc++-v3/config/cpu/cris/atomicity.h b/libstdc++-v3/config/cpu/cris/atomicity.h
index 3162f6ada3b..38ae0de330c 100644
--- a/libstdc++-v3/config/cpu/cris/atomicity.h
+++ b/libstdc++-v3/config/cpu/cris/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: CRIS version -*- C++ -*-
-// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
//
// 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
@@ -47,8 +47,8 @@ namespace __gnu_cxx
" move.d %2,[%3] \n"
" bwf 0b \n"
" clearf \n"
- : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
- : "r" (__mem), "g" (__val), "m" (*__mem)
+ : "=&r" (__result), "=Q" (*__mem), "=&r" (__tmp)
+ : "r" (__mem), "g" (__val), "Q" (*__mem)
/* The memory clobber must stay, regardless of
current uses of this function. */
: "memory");
@@ -60,8 +60,8 @@ namespace __gnu_cxx
" add.d %0,%2 \n"
" move.d %2,[%3] \n"
" move $r9,$ccr \n"
- : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
- : "r" (__mem), "g" (__val), "m" (*__mem)
+ : "=&r" (__result), "=Q" (*__mem), "=&r" (__tmp)
+ : "r" (__mem), "g" (__val), "Q" (*__mem)
: "r9",
/* The memory clobber must stay, regardless of
current uses of this function. */
diff --git a/libstdc++-v3/config/cpu/s390/atomicity.h b/libstdc++-v3/config/cpu/s390/atomicity.h
index b979e3abd33..cf903b321f4 100644
--- a/libstdc++-v3/config/cpu/s390/atomicity.h
+++ b/libstdc++-v3/config/cpu/s390/atomicity.h
@@ -43,7 +43,8 @@ namespace __gnu_cxx
" cs %0,%1,0(%3)\n"
" jl 0b"
: "=&d" (__old_val), "=&d" (__new_val), "=m" (*__mem)
- : "a" (__mem), "d" (__val), "m" (*__mem) : "cc");
+ : "a" (__mem), "d" (__val), "m" (*__mem)
+ : "cc", "memory");
return __old_val;
}
diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu
index df3c674f96f..d7d291485b6 100644
--- a/libstdc++-v3/config/linker-map.gnu
+++ b/libstdc++-v3/config/linker-map.gnu
@@ -410,3 +410,9 @@ CXXABI_1.3 {
local:
*;
};
+
+CXXABI_1.3.1 {
+
+ __cxa_get_exception_ptr;
+
+} CXXABI_1.3;
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 648514f3727..7ddfc53208d 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -8642,7 +8642,7 @@ echo "${ECHO_T}$ac_c99_complex" >&6
if test x"$ac_c99_complex" = x"yes"; then
cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_C99_COMPLEX_MATH 1
+#define _GLIBCXX_USE_C99_COMPLEX 1
_ACEOF
fi
diff --git a/libstdc++-v3/docs/doxygen/user.cfg.in b/libstdc++-v3/docs/doxygen/user.cfg.in
index 4e149d7b8be..dc4595b21ae 100644
--- a/libstdc++-v3/docs/doxygen/user.cfg.in
+++ b/libstdc++-v3/docs/doxygen/user.cfg.in
@@ -73,6 +73,7 @@ INPUT = @srcdir@/docs/doxygen/doxygroups.cc \
include/@host_alias@/bits \
include/bits \
include/ext \
+ include/tr1 \
@srcdir@/libsupc++/exception \
@srcdir@/libsupc++/new \
@srcdir@/libsupc++/typeinfo \
@@ -113,7 +114,14 @@ INPUT = @srcdir@/docs/doxygen/doxygroups.cc \
include/ext/rope \
include/ext/slist \
include/tr1/array \
- include/tr1/tuple
+ include/tr1/functional \
+ include/tr1/hashtable \
+ include/tr1/memory \
+ include/tr1/tuple \
+ include/tr1/type_traits \
+ include/tr1/unordered_map \
+ include/tr1/unordered_set \
+ include/tr1/utility
FILE_PATTERNS = *.h \
*.tcc
RECURSIVE = NO
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html
index fff775e165a..72317f83c5d 100644
--- a/libstdc++-v3/docs/html/ext/howto.html
+++ b/libstdc++-v3/docs/html/ext/howto.html
@@ -503,6 +503,12 @@
Replace "new" with "::new".
+ 409:
+ Closing an fstream should clear the error state
+
+ Have open
clear the error flags.
+
+
434:
bitset::to_string() hard to use
diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html
index abd6ff3d13f..a0315981b1c 100644
--- a/libstdc++-v3/docs/html/faq/index.html
+++ b/libstdc++-v3/docs/html/faq/index.html
@@ -721,6 +721,9 @@ which is no longer available, thanks deja...-->
DR #22 is to leave the flags unchanged. You must insert a call
to fs.clear()
between the calls to close() and open(),
and then everything will work like we all expect it to work.
+ Update: for GCC 4.0 we implemented the resolution
+ of DR #409 and open() now calls
+ clear()
on success!
rel_ops
Another is the rel_ops
namespace and the template
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 3fa1dd65e77..2b811888c40 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -228,11 +228,24 @@ tr1_srcdir = ${glibcxx_srcdir}/include/tr1
tr1_builddir = ./tr1
tr1_headers = \
${tr1_srcdir}/array \
+ ${tr1_srcdir}/bind_repeat.h \
+ ${tr1_srcdir}/bind_iterate.h \
+ ${tr1_srcdir}/boost_shared_ptr.h \
+ ${tr1_srcdir}/mu_iterate.h \
${tr1_srcdir}/functional \
+ ${tr1_srcdir}/functional_iterate.h \
+ ${tr1_srcdir}/memory \
+ ${tr1_srcdir}/ref_fwd.h \
+ ${tr1_srcdir}/ref_wrap_iterate.h \
+ ${tr1_srcdir}/repeat.h \
${tr1_srcdir}/tuple \
+ ${tr1_srcdir}/tuple_iterate.h \
${tr1_srcdir}/utility \
${tr1_srcdir}/type_traits \
- ${tr1_srcdir}/type_traits_fwd.h
+ ${tr1_srcdir}/type_traits_fwd.h \
+ ${tr1_srcdir}/hashtable \
+ ${tr1_srcdir}/unordered_set \
+ ${tr1_srcdir}/unordered_map
# This is the common subset of files that all three "C" header models use.
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index d56d35aab7f..82d9065de90 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -444,11 +444,24 @@ tr1_srcdir = ${glibcxx_srcdir}/include/tr1
tr1_builddir = ./tr1
tr1_headers = \
${tr1_srcdir}/array \
+ ${tr1_srcdir}/bind_repeat.h \
+ ${tr1_srcdir}/bind_iterate.h \
+ ${tr1_srcdir}/boost_shared_ptr.h \
+ ${tr1_srcdir}/mu_iterate.h \
${tr1_srcdir}/functional \
+ ${tr1_srcdir}/functional_iterate.h \
+ ${tr1_srcdir}/memory \
+ ${tr1_srcdir}/ref_fwd.h \
+ ${tr1_srcdir}/ref_wrap_iterate.h \
+ ${tr1_srcdir}/repeat.h \
${tr1_srcdir}/tuple \
+ ${tr1_srcdir}/tuple_iterate.h \
${tr1_srcdir}/utility \
${tr1_srcdir}/type_traits \
- ${tr1_srcdir}/type_traits_fwd.h
+ ${tr1_srcdir}/type_traits_fwd.h \
+ ${tr1_srcdir}/hashtable \
+ ${tr1_srcdir}/unordered_set \
+ ${tr1_srcdir}/unordered_map
# This is the common subset of files that all three "C" header models use.
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 3bdce0f090a..41db0dff438 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -1,6 +1,6 @@
// Components for manipulating sequences of characters -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -425,10 +425,6 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::_Rep::
_M_destroy(const _Alloc& __a) throw ()
{
-#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
- if (this == &_S_empty_rep())
- return;
-#endif
const size_type __size = sizeof(_Rep_base) +
(this->_M_capacity + 1) * sizeof(_CharT);
_Raw_bytes_alloc(__a).deallocate(reinterpret_cast(this), __size);
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 132c3b68eaa..3a7c7d318bb 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -35,7 +35,7 @@
#include
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCXX__ 20050216
+#define __GLIBCXX__ 20050407
// Allow use of "export template." This is currently not a feature
// that g++ supports.
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index a67d2a9a320..426fcba0298 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -155,7 +155,14 @@ namespace std
_ValueType2>)
__glibcxx_function_requires(_ConvertibleConcept<_ValueType2,
_ValueType1>)
- std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value>::
+
+ typedef typename iterator_traits<_ForwardIterator1>::reference
+ _ReferenceType1;
+ typedef typename iterator_traits<_ForwardIterator2>::reference
+ _ReferenceType2;
+ std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value &&
+ __are_same<_ValueType1 &, _ReferenceType1>::__value &&
+ __are_same<_ValueType2 &, _ReferenceType2>::__value>::
iter_swap(__a, __b);
}
diff --git a/libstdc++-v3/include/std/std_complex.h b/libstdc++-v3/include/std/std_complex.h
index 1a5c6a0a259..6c1e0033730 100644
--- a/libstdc++-v3/include/std/std_complex.h
+++ b/libstdc++-v3/include/std/std_complex.h
@@ -561,7 +561,7 @@ namespace std
return __s * sqrt(__x * __x + __y * __y);
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline float
__complex_abs(__complex__ float __z) { return __builtin_cabsf(__z); }
@@ -588,7 +588,7 @@ namespace std
__complex_arg(const complex<_Tp>& __z)
{ return atan2(__z.imag(), __z.real()); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline float
__complex_arg(__complex__ float __z) { return __builtin_cargf(__z); }
@@ -666,7 +666,7 @@ namespace std
return complex<_Tp>(cos(__x) * cosh(__y), -sin(__x) * sinh(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_cos(__complex__ float __z) { return __builtin_ccosf(__z); }
@@ -696,7 +696,7 @@ namespace std
return complex<_Tp>(cosh(__x) * cos(__y), sinh(__x) * sin(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_cosh(__complex__ float __z) { return __builtin_ccoshf(__z); }
@@ -722,7 +722,7 @@ namespace std
__complex_exp(const complex<_Tp>& __z)
{ return std::polar(exp(__z.real()), __z.imag()); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_exp(__complex__ float __z) { return __builtin_cexpf(__z); }
@@ -782,7 +782,7 @@ namespace std
return complex<_Tp>(sin(__x) * cosh(__y), cos(__x) * sinh(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_sin(__complex__ float __z) { return __builtin_csinf(__z); }
@@ -812,7 +812,7 @@ namespace std
return complex<_Tp>(sinh(__x) * cos(__y), cosh(__x) * sin(__y));
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_sinh(__complex__ float __z) { return __builtin_csinhf(__z); }
@@ -856,7 +856,7 @@ namespace std
}
}
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_sqrt(__complex__ float __z) { return __builtin_csqrtf(__z); }
@@ -883,7 +883,7 @@ namespace std
__complex_tan(const complex<_Tp>& __z)
{ return std::sin(__z) / std::cos(__z); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_tan(__complex__ float __z) { return __builtin_ctanf(__z); }
@@ -911,7 +911,7 @@ namespace std
__complex_tanh(const complex<_Tp>& __z)
{ return std::sinh(__z) / std::cosh(__z); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_tanh(__complex__ float __z) { return __builtin_ctanhf(__z); }
@@ -944,6 +944,10 @@ namespace std
complex<_Tp>
pow(const complex<_Tp>& __x, const _Tp& __y)
{
+#ifndef _GLIBCXX_USE_C99_COMPLEX
+ if (__x == _Tp())
+ return _Tp();
+#endif
if (__x.imag() == _Tp() && __x.real() > _Tp())
return pow(__x.real(), __y);
@@ -956,7 +960,7 @@ namespace std
__complex_pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return __x == _Tp() ? _Tp() : std::exp(__y * std::log(__x)); }
-#if _GLIBCXX_USE_C99_COMPLEX_MATH
+#if _GLIBCXX_USE_C99_COMPLEX
inline __complex__ float
__complex_pow(__complex__ float __x, __complex__ float __y)
{ return __builtin_cpowf(__x, __y); }
@@ -966,14 +970,20 @@ namespace std
{ return __builtin_cpow(__x, __y); }
inline __complex__ long double
- __complex_pow(__complex__ long double& __x, __complex__ long double& __y)
+ __complex_pow(const __complex__ long double& __x,
+ const __complex__ long double& __y)
{ return __builtin_cpowl(__x, __y); }
-#endif
+ template
+ inline complex<_Tp>
+ pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
+ { return __complex_pow(__x.__rep(), __y.__rep()); }
+#else
template
inline complex<_Tp>
pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
{ return __complex_pow(__x, __y); }
+#endif
template
inline complex<_Tp>
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index 6993042eb60..c7a934be9f0 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -497,6 +497,10 @@ namespace std
{
if (!_M_filebuf.open(__s, __mode | ios_base::in))
this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
}
/**
@@ -625,6 +629,10 @@ namespace std
{
if (!_M_filebuf.open(__s, __mode | ios_base::out))
this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
}
/**
@@ -751,6 +759,10 @@ namespace std
{
if (!_M_filebuf.open(__s, __mode))
this->setstate(ios_base::failbit);
+ else
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 409. Closing an fstream should clear error state
+ this->clear();
}
/**
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional
index 1e897e2b3c7..abe92e3bf23 100644
--- a/libstdc++-v3/include/tr1/functional
+++ b/libstdc++-v3/include/tr1/functional
@@ -1,6 +1,6 @@
// TR1 functional header -*- C++ -*-
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// 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
@@ -18,53 +18,363 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-/** @file
- * This is a TR1 C++ Library header.
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+/** @file
+ * This is a TR1 C++ Library header.
*/
#ifndef _TR1_FUNCTIONAL
#define _TR1_FUNCTIONAL 1
#include "../functional"
+#include
+#include
+#include
+#include // for std::tr1::hash
+#include // for std::abort
+#include
namespace std
{
namespace tr1
{
+ template
+ class _Mem_fn;
+
+ /**
+ * @if maint
+ * Actual implementation of _Has_result_type, which uses SFINAE to
+ * determine if the type _Tp has a publicly-accessible member type
+ * result_type.
+ * @endif
+ */
+ template
+ class _Has_result_type_helper : __sfinae_types
+ {
+ template
+ struct _Wrap_type
+ { };
+
+ template
+ static __one __test(_Wrap_type*);
+
+ template
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test<_Tp>(0)) == 1;
+ };
+
+ template
+ struct _Has_result_type
+ : integral_constant<
+ bool,
+ _Has_result_type_helper::type>::value>
+ { };
+
+ /**
+ * @if maint
+ * If we have found a result_type, extract it.
+ * @endif
+ */
+ template
+ struct _Maybe_get_result_type
+ { };
+
+ template
+ struct _Maybe_get_result_type
+ {
+ typedef typename _Functor::result_type result_type;
+ };
+
+ /**
+ * @if maint
+ * Base class for any function object that has a weak result type, as
+ * defined in 3.3/3 of TR1.
+ * @endif
+ */
+ template
+ struct _Weak_result_type_impl
+ : _Maybe_get_result_type<_Has_result_type<_Functor>::value, _Functor>
+ {
+ };
+
+ /**
+ * @if maint
+ * Strip top-level cv-qualifiers from the function object and let
+ * _Weak_result_type_impl perform the real work.
+ * @endif
+ */
+ template
+ struct _Weak_result_type
+ : _Weak_result_type_impl::type>
+ {
+ };
+
+ template
+ class result_of;
+
+ /**
+ * @if maint
+ * Actual implementation of result_of. When _Has_result_type is
+ * true, gets its result from _Weak_result_type. Otherwise, uses
+ * the function object's member template result to extract the
+ * result type.
+ * @endif
+ */
+ template
+ struct _Result_of_impl;
+
+ // Handle member data pointers using _Mem_fn's logic
+ template
+ struct _Result_of_impl
+ {
+ typedef typename _Mem_fn<_Res _Class::*>
+ ::template _Result_type<_T1>::type type;
+ };
+
+ /**
+ * @if maint
+ * Determines if the type _Tp derives from unary_function.
+ * @endif
+ */
+ template
+ struct _Derives_from_unary_function : __sfinae_types
+ {
+ private:
+ template
+ static __one __test(const volatile unary_function<_T1, _Res>*);
+
+ // It's tempting to change "..." to const volatile void*, but
+ // that fails when _Tp is a function type.
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test((_Tp*)0)) == 1;
+ };
+
+ /**
+ * @if maint
+ * Determines if the type _Tp derives from binary_function.
+ * @endif
+ */
+ template
+ struct _Derives_from_binary_function : __sfinae_types
+ {
+ private:
+ template
+ static __one __test(const volatile binary_function<_T1, _T2, _Res>*);
+
+ // It's tempting to change "..." to const volatile void*, but
+ // that fails when _Tp is a function type.
+ static __two __test(...);
+
+ public:
+ static const bool value = sizeof(__test((_Tp*)0)) == 1;
+ };
+
+ /**
+ * @if maint
+ * Turns a function type into a function pointer type
+ * @endif
+ */
+ template::value>
+ struct _Function_to_function_pointer
+ {
+ typedef _Tp type;
+ };
+
+ template
+ struct _Function_to_function_pointer<_Tp, true>
+ {
+ typedef _Tp* type;
+ };
+
+ /**
+ * @if maint
+ * Knowing which of unary_function and binary_function _Tp derives
+ * from, derives from the same and ensures that reference_wrapper
+ * will have a weak result type. See cases below.
+ * @endif
+ */
+ template
+ struct _Reference_wrapper_base_impl;
+
+ // Not a unary_function or binary_function, so try a weak result type
+ template
+ struct _Reference_wrapper_base_impl
+ : _Weak_result_type<_Tp>
+ { };
+
+ // unary_function but not binary_function
+ template
+ struct _Reference_wrapper_base_impl
+ : unary_function
+ { };
+
+ // binary_function but not unary_function
+ template
+ struct _Reference_wrapper_base_impl
+ : binary_function
+ { };
+
+ // both unary_function and binary_function. import result_type to
+ // avoid conflicts.
+ template
+ struct _Reference_wrapper_base_impl
+ : unary_function,
+ binary_function
+ {
+ typedef typename _Tp::result_type result_type;
+ };
+
+ /**
+ * @if maint
+ * Derives from unary_function or binary_function when it
+ * can. Specializations handle all of the easy cases. The primary
+ * template determines what to do with a class type, which may
+ * derive from both unary_function and binary_function.
+ * @endif
+ */
+ template
+ struct _Reference_wrapper_base
+ : _Reference_wrapper_base_impl<
+ _Derives_from_unary_function<_Tp>::value,
+ _Derives_from_binary_function<_Tp>::value,
+ _Tp>
+ { };
+
+ // - a function type (unary)
+ template
+ struct _Reference_wrapper_base<_Res(_T1)>
+ : unary_function<_T1, _Res>
+ { };
+
+ // - a function type (binary)
+ template
+ struct _Reference_wrapper_base<_Res(_T1, _T2)>
+ : binary_function<_T1, _T2, _Res>
+ { };
+
+ // - a function pointer type (unary)
+ template
+ struct _Reference_wrapper_base<_Res(*)(_T1)>
+ : unary_function<_T1, _Res>
+ { };
+
+ // - a function pointer type (binary)
+ template
+ struct _Reference_wrapper_base<_Res(*)(_T1, _T2)>
+ : binary_function<_T1, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, no qualifiers)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)()>
+ : unary_function<_T1*, _Res>
+ { };
+
+ // - a pointer to member function type (binary, no qualifiers)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2)>
+ : binary_function<_T1*, _T2, _Res>
+ { };
+
+ // - a pointer to member function type (unary, const)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)() const>
+ : unary_function
+ { };
+
+ // - a pointer to member function type (binary, const)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const>
+ : binary_function
+ { };
+
+ // - a pointer to member function type (unary, volatile)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)() volatile>
+ : unary_function
+ { };
+
+ // - a pointer to member function type (binary, volatile)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) volatile>
+ : binary_function
+ { };
+
+ // - a pointer to member function type (unary, const volatile)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)() const volatile>
+ : unary_function
+ { };
+
+ // - a pointer to member function type (binary, const volatile)
+ template
+ struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const volatile>
+ : binary_function
+ { };
+
template
class reference_wrapper
+ : public _Reference_wrapper_base::type>
{
+ // If _Tp is a function type, we can't form result_of<_Tp(...)>,
+ // so turn it into a function pointer type.
+ typedef typename _Function_to_function_pointer<_Tp>::type
+ _M_func_type;
+
_Tp* _M_data;
public:
typedef _Tp type;
explicit reference_wrapper(_Tp& __indata): _M_data(&__indata)
{ }
-
+
reference_wrapper(const reference_wrapper<_Tp>& __inref):
_M_data(__inref._M_data)
{ }
- reference_wrapper&
+ reference_wrapper&
operator=(const reference_wrapper<_Tp>& __inref)
{
- _M_data = __inref._M_data;
- return *this;
+ _M_data = __inref._M_data;
+ return *this;
}
-
+
operator _Tp&() const
{ return this->get(); }
-
+
_Tp&
get() const
{ return *_M_data; }
+
+#define _GLIBCXX_REPEAT_HEADER
+#include
+#undef _GLIBCXX_REPEAT_HEADER
};
-
+
+
// Denotes a reference should be taken to a variable.
template
reference_wrapper<_Tp>
ref(_Tp& __t)
{ return reference_wrapper<_Tp>(__t); }
-
+
// Denotes a const reference should be taken to a variable.
template
reference_wrapper
@@ -78,8 +388,777 @@ namespace tr1
template
reference_wrapper cref(reference_wrapper<_Tp> __t)
{ return cref(__t.get()); }
+
+ template
+ struct _Mem_fn_const_or_non
+ {
+ typedef const _Tp& type;
+ };
+
+ template
+ struct _Mem_fn_const_or_non<_Tp, false>
+ {
+ typedef _Tp& type;
+ };
+
+ template
+ class _Mem_fn<_Res _Class::*>
+ {
+ // This bit of genius is due to Peter Dimov, improved slightly by
+ // Douglas Gregor.
+ template
+ _Res&
+ _M_call(_Tp& __object, _Class *) const
+ { return __object.*__pm; }
+
+ template
+ _Res&
+ _M_call(_Tp& __object, _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template
+ const _Res&
+ _M_call(_Tp& __object, const _Up * const *) const
+ { return (*__object).*__pm; }
+
+ template
+ const _Res&
+ _M_call(_Tp& __object, const _Class *) const
+ { return __object.*__pm; }
+
+ template
+ const _Res&
+ _M_call(_Tp& __ptr, const volatile void*) const
+ { return (*__ptr).*__pm; }
+
+ template static _Tp& __get_ref();
+
+ template
+ static __sfinae_types::__one __check_const(_Tp&, _Class*);
+ template
+ static __sfinae_types::__one __check_const(_Tp&, _Up * const *);
+ template
+ static __sfinae_types::__two __check_const(_Tp&, const _Up * const *);
+ template
+ static __sfinae_types::__two __check_const(_Tp&, const _Class*);
+ template
+ static __sfinae_types::__two __check_const(_Tp&, const volatile void*);
+
+ public:
+ template
+ struct _Result_type
+ : _Mem_fn_const_or_non<
+ _Res,
+ (sizeof(__sfinae_types::__two)
+ == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
+ { };
+
+ template
+ struct result;
+
+ template
+ struct result<_CVMem(_Tp)>
+ : public _Result_type<_Tp> { };
+
+ template
+ struct result<_CVMem(_Tp&)>
+ : public _Result_type<_Tp> { };
+
+ explicit _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { }
+
+ // Handle objects
+ _Res& operator()(_Class& __object) const
+ { return __object.*__pm; }
+
+ const _Res& operator()(const _Class& __object) const
+ { return __object.*__pm; }
+
+ // Handle pointers
+ _Res& operator()(_Class* __object) const
+ { return __object->*__pm; }
+
+ const _Res&
+ operator()(const _Class* __object) const
+ { return __object->*__pm; }
+
+ // Handle smart pointers and derived
+ template
+ typename _Result_type<_Tp>::type
+ operator()(_Tp& __unknown) const
+ { return _M_call(__unknown, &__unknown); }
+
+ private:
+ _Res _Class::*__pm;
+ };
+
+ /**
+ * @brief Returns a function object that forwards to the member
+ * pointer @a pm.
+ */
+ template
+ inline _Mem_fn<_Tp _Class::*>
+ mem_fn(_Tp _Class::* __pm)
+ {
+ return _Mem_fn<_Tp _Class::*>(__pm);
+ }
+
+ /**
+ * @brief Determines if the given type _Tp is a function object
+ * should be treated as a subexpression when evaluating calls to
+ * function objects returned by bind(). [TR1 3.6.1]
+ */
+ template
+ struct is_bind_expression
+ {
+ static const bool value = false;
+ };
+
+ /**
+ * @brief Determines if the given type _Tp is a placeholder in a
+ * bind() expression and, if so, which placeholder it is. [TR1 3.6.2]
+ */
+ template
+ struct is_placeholder
+ {
+ static const int value = 0;
+ };
+
+ /**
+ * @if maint
+ * The type of placeholder objects defined by libstdc++.
+ * @endif
+ */
+ template struct _Placeholder { };
+
+ /**
+ * @if maint
+ * Partial specialization of is_placeholder that provides the placeholder
+ * number for the placeholder objects defined by libstdc++.
+ * @endif
+ */
+ template
+ struct is_placeholder<_Placeholder<_Num> >
+ {
+ static const int value = _Num;
+ };
+
+ /**
+ * @if maint
+ * Maps an argument to bind() into an actual argument to the bound
+ * function object [TR1 3.6.3/5]. Only the first parameter should
+ * be specified: the rest are used to determine among the various
+ * implementations. Note that, although this class is a function
+ * object, isn't not entirely normal because it takes only two
+ * parameters regardless of the number of parameters passed to the
+ * bind expression. The first parameter is the bound argument and
+ * the second parameter is a tuple containing references to the
+ * rest of the arguments.
+ * @endif
+ */
+ template::value,
+ bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
+ class _Mu;
+
+ /**
+ * @if maint
+ * If the argument is reference_wrapper<_Tp>, returns the
+ * underlying reference. [TR1 3.6.3/5 bullet 1]
+ * @endif
+ */
+ template
+ class _Mu, false, false>
+ {
+ public:
+ typedef _Tp& result_type;
+
+ /* Note: This won't actually work for const volatile
+ * reference_wrappers, because reference_wrapper::get() is const
+ * but not volatile-qualified. This might be a defect in the TR.
+ */
+ template
+ result_type
+ operator()(_CVRef& __arg, const _Tuple&) const volatile
+ { return __arg.get(); }
+ };
+
+ /**
+ * @if maint
+ * If the argument is a bind expression, we invoke the underlying
+ * function object with the same cv-qualifiers as we are given and
+ * pass along all of our arguments (unwrapped). [TR1 3.6.3/5 bullet 2]
+ * @endif
+ */
+ template
+ class _Mu<_Arg, true, false>
+ {
+ public:
+ template class result;
+
+#define _GLIBCXX_REPEAT_HEADER
+# include
+#undef _GLIBCXX_REPEAT_HEADER
+ };
+
+ /**
+ * @if maint
+ * If the argument is a placeholder for the Nth argument, returns
+ * a reference to the Nth argument to the bind function object.
+ * [TR1 3.6.3/5 bullet 3]
+ * @endif
+ */
+ template
+ class _Mu<_Arg, false, true>
+ {
+ public:
+ template class result;
+
+ template
+ class result<_CVMu(_CVArg, _Tuple)>
+ {
+ // Add a reference, if it hasn't already been done for us.
+ // This allows us to be a little bit sloppy in constructing
+ // the tuple that we pass to result_of<...>.
+ typedef typename tuple_element<(is_placeholder<_Arg>::value - 1),
+ _Tuple>::type __base_type;
+
+ public:
+ typedef typename add_reference<__base_type>::type type;
+ };
+
+ template
+ typename result<_Mu(_Arg, _Tuple)>::type
+ operator()(const volatile _Arg&, const _Tuple& __tuple) const volatile
+ {
+ return ::std::tr1::get<(is_placeholder<_Arg>::value - 1)>(__tuple);
+ }
+ };
+
+ /**
+ * @if maint
+ * If the argument is just a value, returns a reference to that
+ * value. The cv-qualifiers on the reference are the same as the
+ * cv-qualifiers on the _Mu object. [TR1 3.6.3/5 bullet 4]
+ * @endif
+ */
+ template
+ class _Mu<_Arg, false, false>
+ {
+ public:
+ template struct result;
+
+ template
+ struct result<_CVMu(_CVArg, _Tuple)>
+ {
+ typedef typename add_reference<_CVArg>::type type;
+ };
+
+ // Pick up the cv-qualifiers of the argument
+ template
+ _CVArg& operator()(_CVArg& __arg, const _Tuple&) const volatile
+ { return __arg; }
+ };
+
+ /**
+ * @if maint
+ * Maps member pointers into instances of _Mem_fn but leaves all
+ * other function objects untouched. Used by tr1::bind(). The
+ * primary template handles the non--member-pointer case.
+ * @endif
+ */
+ template
+ struct _Maybe_wrap_member_pointer
+ {
+ typedef _Tp type;
+ static const _Tp& __do_wrap(const _Tp& __x) { return __x; }
+ };
+
+ /**
+ * @if maint
+ * Maps member pointers into instances of _Mem_fn but leaves all
+ * other function objects untouched. Used by tr1::bind(). This
+ * partial specialization handles the member pointer case.
+ * @endif
+ */
+ template
+ struct _Maybe_wrap_member_pointer<_Tp _Class::*>
+ {
+ typedef _Mem_fn<_Tp _Class::*> type;
+ static type __do_wrap(_Tp _Class::* __pm) { return type(__pm); }
+ };
+
+ /**
+ * @if maint
+ * Type of the function object returned from bind().
+ * @endif
+ */
+ template
+ struct _Bind;
+
+ /**
+ * @if maint
+ * Type of the function object returned from bind().
+ * @endif
+ */
+ template
+ struct _Bind_result;
+
+ /**
+ * @if maint
+ * Class template _Bind is always a bind expression.
+ * @endif
+ */
+ template
+ struct is_bind_expression<_Bind<_Signature> >
+ {
+ static const bool value = true;
+ };
+
+ /**
+ * @if maint
+ * Class template _Bind_result is always a bind expression.
+ * @endif
+ */
+ template
+ struct is_bind_expression<_Bind_result<_Result, _Signature> >
+ {
+ static const bool value = true;
+ };
+
+ /**
+ * @brief Exception class thrown when class template function's
+ * operator() is called with an empty target.
+ *
+ */
+ class bad_function_call : public std::exception { };
+
+ /**
+ * @if maint
+ * The integral constant expression 0 can be converted into a
+ * pointer to this type. It is used by the function template to
+ * accept NULL pointers.
+ * @endif
+ */
+ struct _M_clear_type;
+
+ /**
+ * @if maint
+ * Trait identifying "location-invariant" types, meaning that the
+ * address of the object (or any of its members) will not escape.
+ * Also implies a trivial copy constructor and assignment operator.
+ * @endif
+ */
+ template
+ struct __is_location_invariant
+ : integral_constant::value
+ || is_member_pointer<_Tp>::value)>
+ {
+ };
+
+ class _Undefined_class;
+
+ union _Nocopy_types
+ {
+ void* _M_object;
+ const void* _M_const_object;
+ void (*_M_function_pointer)();
+ void (_Undefined_class::*_M_member_pointer)();
+ };
+
+ union _Any_data {
+ void* _M_access() { return &_M_pod_data[0]; }
+ const void* _M_access() const { return &_M_pod_data[0]; }
+
+ template _Tp& _M_access()
+ { return *static_cast<_Tp*>(_M_access()); }
+
+ template const _Tp& _M_access() const
+ { return *static_cast(_M_access()); }
+
+ _Nocopy_types _M_unused;
+ char _M_pod_data[sizeof(_Nocopy_types)];
+ };
+
+ enum _Manager_operation
+ {
+ __get_type_info,
+ __get_functor_ptr,
+ __clone_functor,
+ __destroy_functor
+ };
+
+ /* Simple type wrapper that helps avoid annoying const problems
+ when casting between void pointers and pointers-to-pointers. */
+ template
+ struct _Simple_type_wrapper
+ {
+ _Simple_type_wrapper(_Tp __value) : __value(__value) { }
+
+ _Tp __value;
+ };
+
+ template
+ struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
+ : __is_location_invariant<_Tp>
+ {
+ };
+
+ // Converts a reference to a function object into a callable
+ // function object.
+ template
+ inline _Functor& __callable_functor(_Functor& __f) { return __f; }
+
+ template
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* &__p)
+ { return mem_fn(__p); }
+
+ template
+ inline _Mem_fn<_Member _Class::*>
+ __callable_functor(_Member _Class::* const &__p)
+ { return mem_fn(__p); }
+
+ template
+ class _Function_handler;
+
+ template
+ class function;
+
+
+ /**
+ * @if maint
+ * Base class of all polymorphic function object wrappers.
+ * @endif
+ */
+ class _Function_base
+ {
+ public:
+ static const std::size_t _M_max_size = sizeof(_Nocopy_types);
+ static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
+
+ template
+ class _Base_manager
+ {
+ protected:
+ static const bool __stored_locally =
+ (__is_location_invariant<_Functor>::value
+ && sizeof(_Functor) <= _M_max_size
+ && __alignof__(_Functor) <= _M_max_align
+ && (_M_max_align % __alignof__(_Functor) == 0));
+ typedef integral_constant _Local_storage;
+
+ // Retrieve a pointer to the function object
+ static _Functor* _M_get_pointer(const _Any_data& __source)
+ {
+ const _Functor* __ptr =
+ __stored_locally? &__source._M_access<_Functor>()
+ /* have stored a pointer */ : __source._M_access<_Functor*>();
+ return const_cast<_Functor*>(__ptr);
+ }
+
+ // Clone a location-invariant function object that fits within
+ // an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
+ {
+ new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
+ }
+
+ // Clone a function object that is not location-invariant or
+ // that cannot fit into an _Any_data structure.
+ static void
+ _M_clone(_Any_data& __dest, const _Any_data& __source, false_type)
+ {
+ __dest._M_access<_Functor*>() =
+ new _Functor(*__source._M_access<_Functor*>());
+ }
+
+ // Destroying a location-invariant object may still require
+ // destruction.
+ static void
+ _M_destroy(_Any_data& __victim, true_type)
+ {
+ __victim._M_access<_Functor>().~_Functor();
+ }
+
+ // Destroying an object located on the heap.
+ static void
+ _M_destroy(_Any_data& __victim, false_type)
+ {
+ delete __victim._M_access<_Functor*>();
+ }
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op) {
+ case __get_type_info:
+ __dest._M_access() = &typeid(_Functor);
+ break;
+
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = _M_get_pointer(__source);
+ break;
+
+ case __clone_functor:
+ _M_clone(__dest, __source, _Local_storage());
+ break;
+
+ case __destroy_functor:
+ _M_destroy(__dest, _Local_storage());
+ break;
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f)
+ {
+ _M_init_functor(__functor, __f, _Local_storage());
+ }
+
+ template
+ static bool
+ _M_not_empty_function(const function<_Signature>& __f)
+ {
+ return __f;
+ }
+
+ template
+ static bool
+ _M_not_empty_function(const _Tp*& __fp)
+ {
+ return __fp;
+ }
+
+ template
+ static bool
+ _M_not_empty_function(_Tp _Class::* const& __mp)
+ {
+ return __mp;
+ }
+
+ template
+ static bool
+ _M_not_empty_function(const _Tp&)
+ {
+ return true;
+ }
+
+ private:
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, true_type)
+ {
+ new (__functor._M_access()) _Functor(__f);
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, const _Functor& __f, false_type)
+ {
+ __functor._M_access<_Functor*>() = new _Functor(__f);
+ }
+ };
+
+ template
+ class _Ref_manager : public _Base_manager<_Functor*>
+ {
+ typedef _Function_base::_Base_manager<_Functor*> _Base;
+
+ public:
+ static bool
+ _M_manager(_Any_data& __dest, const _Any_data& __source,
+ _Manager_operation __op)
+ {
+ switch (__op) {
+ case __get_type_info:
+ __dest._M_access() = &typeid(_Functor);
+ break;
+
+ case __get_functor_ptr:
+ __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
+ return is_const<_Functor>::value;
+ break;
+
+ default:
+ _Base::_M_manager(__dest, __source, __op);
+ }
+ return false;
+ }
+
+ static void
+ _M_init_functor(_Any_data& __functor, reference_wrapper<_Functor> __f)
+ {
+ // TBD: Use address_of function instead
+ _Base::_M_init_functor(__functor, &__f.get());
+ }
+ };
+
+ _Function_base() : _M_manager(0) { }
+
+ ~_Function_base()
+ {
+ if (_M_manager)
+ {
+ _M_manager(_M_functor, _M_functor, __destroy_functor);
+ }
+ }
+
+
+ bool _M_empty() const { return !_M_manager; }
+
+ typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
+ _Manager_operation);
+
+ _Any_data _M_functor;
+ _Manager_type _M_manager;
+ };
+
+ // [3.7.2.7] null pointer comparisons
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c true if the wrapper has no target, @c false otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template
+ inline bool
+ operator==(const function<_Signature>& __f, _M_clear_type*)
+ {
+ return !__f;
+ }
+
+ /**
+ * @overload
+ */
+ template
+ inline bool
+ operator==(_M_clear_type*, const function<_Signature>& __f)
+ {
+ return !__f;
+ }
+
+ /**
+ * @brief Compares a polymorphic function object wrapper against 0
+ * (the NULL pointer).
+ * @returns @c false if the wrapper has no target, @c true otherwise
+ *
+ * This function will not throw an exception.
+ */
+ template
+ inline bool
+ operator!=(const function<_Signature>& __f, _M_clear_type*)
+ {
+ return __f;
+ }
+
+ /**
+ * @overload
+ */
+ template
+ inline bool
+ operator!=(_M_clear_type*, const function<_Signature>& __f)
+ {
+ return __f;
+ }
+
+ // [3.7.2.8] specialized algorithms
+
+ /**
+ * @brief Swap the targets of two polymorphic function object wrappers.
+ *
+ * This function will not throw an exception.
+ */
+ template
+ inline void
+ swap(function<_Signature>& __x, function<_Signature>& __y)
+ {
+ __x.swap(__y);
+ }
+
+#define _GLIBCXX_JOIN(X,Y) _GLIBCXX_JOIN2( X , Y )
+#define _GLIBCXX_JOIN2(X,Y) _GLIBCXX_JOIN3(X,Y)
+#define _GLIBCXX_JOIN3(X,Y) X##Y
+#define _GLIBCXX_REPEAT_HEADER
+#include
+#undef _GLIBCXX_REPEAT_HEADER
+#undef _GLIBCXX_JOIN3
+#undef _GLIBCXX_JOIN2
+#undef _GLIBCXX_JOIN
+
+// Definition of default hash function std::tr1::hash<>. The types for
+// which std::tr1::hash is defined is in clause 6.3.3. of the PDTR.
+
+ template struct hash;
+
+ #define tr1_hashtable_define_trivial_hash(T) \
+ template <> struct hash { \
+ std::size_t operator()(T val) const { return static_cast(val); } \
+ } \
+
+ tr1_hashtable_define_trivial_hash(bool);
+ tr1_hashtable_define_trivial_hash(char);
+ tr1_hashtable_define_trivial_hash(signed char);
+ tr1_hashtable_define_trivial_hash(unsigned char);
+ tr1_hashtable_define_trivial_hash(wchar_t);
+ tr1_hashtable_define_trivial_hash(short);
+ tr1_hashtable_define_trivial_hash(int);
+ tr1_hashtable_define_trivial_hash(long);
+ tr1_hashtable_define_trivial_hash(unsigned short);
+ tr1_hashtable_define_trivial_hash(unsigned int);
+ tr1_hashtable_define_trivial_hash(unsigned long);
+
+ tr1_hashtable_define_trivial_hash(float);
+ tr1_hashtable_define_trivial_hash(double);
+ tr1_hashtable_define_trivial_hash(long double);
+
+ #undef tr1_hashtable_define_trivial_hash
+
+ template
+ struct hash {
+ std::size_t operator()(T* p) const {
+ return reinterpret_cast(p);
+ }
+ };
+
+ // ??? We can probably find a better hash function than this (i.e. one
+ // that vectorizes better and that produces a more uniform distribution).
+
+ // XXX String hash probably shouldn't be an inline member function,
+ // since it's nontrivial. Once we have the framework for TR1 .cc
+ // files, this should go in one.
+
+ template <>
+ struct hash
+ {
+ std::size_t operator()(const std::string& s) const
+ {
+ std::size_t result = 0;
+ for (std::string::const_iterator i = s.begin(); i != s.end(); ++i)
+ result = (result * 131) + *i;
+ return result;
+ }
+ };
+
+#ifdef _GLIBCXX_USE_WCHAR_T
+ template <>
+ struct hash
+ {
+ std::size_t operator()(const std::wstring& s) const
+ {
+ std::size_t result = 0;
+ for (std::wstring::const_iterator i = s.begin(); i != s.end(); ++i)
+ result = (result * 131) + *i;
+ return result;
+ }
+ };
+#endif
+
}
}
#endif
-
diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple
index 928c75f88cf..89bccc3d495 100644
--- a/libstdc++-v3/include/tr1/tuple
+++ b/libstdc++-v3/include/tr1/tuple
@@ -1,6 +1,6 @@
// class template tuple -*- C++ -*-
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
//
// 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
@@ -18,1432 +18,258 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-/** @file
- * This is a TR1 C++ Library header.
- */
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
-// Chris Jefferson
+/** @file
+* This is a TR1 C++ Library header.
+*/
-// This header is automatically generated: see maketuple.c for details.
+// Chris Jefferson
#ifndef _TUPLE
#define _TUPLE 1
#include
-#include
+#include
namespace std
{
namespace tr1
{
- // An implementation specific class which is used in the tuple class
- // when the tuple is not maximum possible size.
- struct _NullClass { };
-
- template
- class tuple;
-
- /// Gives the type of the ith element of a given tuple type.
- template
- struct tuple_element;
-
- template
- struct tuple_element<0, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp0 type; };
-
- template
- struct tuple_element<1, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp1 type; };
-
- template
- struct tuple_element<2, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp2 type; };
-
- template
- struct tuple_element<3, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp3 type; };
-
- template
- struct tuple_element<4, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp4 type; };
-
- template
- struct tuple_element<5, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp5 type; };
-
- template
- struct tuple_element<6, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp6 type; };
-
- template
- struct tuple_element<7, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp7 type; };
-
- template
- struct tuple_element<8, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp8 type; };
-
- /// @brief class tuple_element
- template
- struct tuple_element<9, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6,
- _Tp7, _Tp8, _Tp9> >
- { typedef _Tp9 type; };
-
- /// Finds the size of a given tuple type.
- template
- struct tuple_size;
-
- template<>
- struct tuple_size >
- { static const int value = 0; };
-
- template< typename _Tp0>
- struct tuple_size >
- { static const int value = 1; };
-
- template
- struct tuple_size >
- { static const int value = 2; };
-
- template
- struct tuple_size >
- { static const int value = 3; };
-
- template
- struct tuple_size >
- { static const int value = 4; };
-
- template
- struct tuple_size >
- { static const int value = 5; };
-
- template
- struct tuple_size >
- { static const int value = 6; };
-
- template
- struct tuple_size >
- { static const int value = 7; };
-
- template
- struct tuple_size >
- { static const int value = 8; };
-
- template
- struct tuple_size >
- { static const int value = 9; };
-
- /// @brief class tuple_size
- template
- struct tuple_size >
- { static const int value = 10; };
-
- // Adds a const reference to a non-reference type.
- template
- struct __add_c_ref
- { typedef const _Tp& type; };
-
- template
- struct __add_c_ref<_Tp&>
- { typedef _Tp& type; };
-
- // Adds a reference to a non-reference type.
- template
- struct __add_ref
- { typedef _Tp& type; };
-
- template
- struct __add_ref<_Tp&>
- { typedef _Tp& type; };
-
- // The empty tuple.
- template<>
- class tuple<_NullClass, _NullClass, _NullClass, _NullClass, _NullClass,
- _NullClass, _NullClass, _NullClass, _NullClass, _NullClass>
- {
- public:
- tuple()
- { }
-
- tuple(const tuple& __in)
- { }
-
- tuple& operator=(const tuple& __in)
- { return *this; }
- };
-
- template< typename _Tp0>
- class tuple< _Tp0, _NullClass, _NullClass, _NullClass, _NullClass,
- _NullClass, _NullClass, _NullClass, _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
-
- public:
- tuple()
- { }
-
- explicit tuple( typename __add_c_ref<_Tp0>::type __in0):
- _M_t0(__in0)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0)
- { }
-
- template< typename _Up0>
- tuple(const tuple< _Up0>& __in):
- _M_t0(__in._M_t0)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- return *this;
- }
-
- template< typename _Up0>
- tuple&
- operator=(const tuple< _Up0>& __in)
- {
- _M_t0=__in._M_t0;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _NullClass, _NullClass, _NullClass, _NullClass,
- _NullClass, _NullClass, _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1):
- _M_t0(__in0), _M_t1(__in1)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1)
- { }
-
- template
- tuple(const std::pair<_Up1, _Up2>& __u):
- _M_t0(__u.first), _M_t1(__u.second)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _NullClass, _NullClass, _NullClass,
- _NullClass, _NullClass, _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _Tp3, _NullClass, _NullClass, _NullClass,
- _NullClass, _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _NullClass, _NullClass,
- _NullClass, _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
- _Tp4 _M_t4;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3,
- typename __add_c_ref<_Tp4>::type __in4):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3), _M_t4(__in4)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _NullClass, _NullClass,
- _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
- _Tp4 _M_t4;
- _Tp5 _M_t5;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3,
- typename __add_c_ref<_Tp4>::type __in4,
- typename __add_c_ref<_Tp5>::type __in5):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3), _M_t4(__in4),
- _M_t5(__in5)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _NullClass,
- _NullClass, _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
- _Tp4 _M_t4;
- _Tp5 _M_t5;
- _Tp6 _M_t6;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3,
- typename __add_c_ref<_Tp4>::type __in4,
- typename __add_c_ref<_Tp5>::type __in5,
- typename __add_c_ref<_Tp6>::type __in6):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3), _M_t4(__in4),
- _M_t5(__in5), _M_t6(__in6)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5,
- _Up6>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _NullClass,
- _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
- _Tp4 _M_t4;
- _Tp5 _M_t5;
- _Tp6 _M_t6;
- _Tp7 _M_t7;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3,
- typename __add_c_ref<_Tp4>::type __in4,
- typename __add_c_ref<_Tp5>::type __in5,
- typename __add_c_ref<_Tp6>::type __in6,
- typename __add_c_ref<_Tp7>::type __in7):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3), _M_t4(__in4),
- _M_t5(__in5), _M_t6(__in6), _M_t7(__in7)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6), _M_t7(__in._M_t7)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6,
- _Up7>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6), _M_t7(__in._M_t7)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- _M_t7=__in._M_t7;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6,
- _Up7>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- _M_t7=__in._M_t7;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- template
- class tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8,
- _NullClass>
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
- _Tp4 _M_t4;
- _Tp5 _M_t5;
- _Tp6 _M_t6;
- _Tp7 _M_t7;
- _Tp8 _M_t8;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3,
- typename __add_c_ref<_Tp4>::type __in4,
- typename __add_c_ref<_Tp5>::type __in5,
- typename __add_c_ref<_Tp6>::type __in6,
- typename __add_c_ref<_Tp7>::type __in7,
- typename __add_c_ref<_Tp8>::type __in8):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3), _M_t4(__in4),
- _M_t5(__in5), _M_t6(__in6), _M_t7(__in7), _M_t8(__in8)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6), _M_t7(__in._M_t7), _M_t8(__in._M_t8)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7,
- _Up8>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6), _M_t7(__in._M_t7), _M_t8(__in._M_t8)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- _M_t7=__in._M_t7;
- _M_t8=__in._M_t8;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7,
- _Up8>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- _M_t7=__in._M_t7;
- _M_t8=__in._M_t8;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- /// @brief Template class tuple
- template
- class tuple
- {
- _Tp0 _M_t0;
- _Tp1 _M_t1;
- _Tp2 _M_t2;
- _Tp3 _M_t3;
- _Tp4 _M_t4;
- _Tp5 _M_t5;
- _Tp6 _M_t6;
- _Tp7 _M_t7;
- _Tp8 _M_t8;
- _Tp9 _M_t9;
-
- public:
- tuple()
- { }
-
- explicit tuple(typename __add_c_ref<_Tp0>::type __in0,
- typename __add_c_ref<_Tp1>::type __in1,
- typename __add_c_ref<_Tp2>::type __in2,
- typename __add_c_ref<_Tp3>::type __in3,
- typename __add_c_ref<_Tp4>::type __in4,
- typename __add_c_ref<_Tp5>::type __in5,
- typename __add_c_ref<_Tp6>::type __in6,
- typename __add_c_ref<_Tp7>::type __in7,
- typename __add_c_ref<_Tp8>::type __in8,
- typename __add_c_ref<_Tp9>::type __in9):
- _M_t0(__in0), _M_t1(__in1), _M_t2(__in2), _M_t3(__in3), _M_t4(__in4),
- _M_t5(__in5), _M_t6(__in6), _M_t7(__in7), _M_t8(__in8), _M_t9(__in9)
- { }
-
- tuple(const tuple& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6), _M_t7(__in._M_t7), _M_t8(__in._M_t8),
- _M_t9(__in._M_t9)
- { }
-
- template
- tuple(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8,
- _Up9>& __in):
- _M_t0(__in._M_t0), _M_t1(__in._M_t1), _M_t2(__in._M_t2),
- _M_t3(__in._M_t3), _M_t4(__in._M_t4), _M_t5(__in._M_t5),
- _M_t6(__in._M_t6), _M_t7(__in._M_t7), _M_t8(__in._M_t8),
- _M_t9(__in._M_t9)
- { }
-
- tuple&
- operator=(const tuple& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- _M_t7=__in._M_t7;
- _M_t8=__in._M_t8;
- _M_t9=__in._M_t9;
- return *this;
- }
-
- template
- tuple&
- operator=(const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7,
- _Up8, _Up9>& __in)
- {
- _M_t0=__in._M_t0;
- _M_t1=__in._M_t1;
- _M_t2=__in._M_t2;
- _M_t3=__in._M_t3;
- _M_t4=__in._M_t4;
- _M_t5=__in._M_t5;
- _M_t6=__in._M_t6;
- _M_t7=__in._M_t7;
- _M_t8=__in._M_t8;
- _M_t9=__in._M_t9;
- return *this;
- }
-
- template
- friend class __get_helper;
- template
- friend class tuple;
- };
-
- // Class used in the implementation of get
- template
- struct __get_helper;
-
- template
- struct __get_helper<0, _Tp>
- {
- static typename __add_ref