diff options
Diffstat (limited to 'libstdc++-v3/include')
44 files changed, 3005 insertions, 3117 deletions
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 84ed1bfdad0..abd9abf4e70 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -228,12 +228,18 @@ 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 \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 0476f465984..60bf72bf3c4 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -40,10 +40,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/fragment.am subdir = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/linkage.m4 \ - $(top_srcdir)/../config/no-executables.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/no-executables.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/crossconfig.m4 \ + $(top_srcdir)/linkage.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -116,10 +115,6 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@ GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@ -GLIBCXX_TEST_THREAD_FALSE = @GLIBCXX_TEST_THREAD_FALSE@ -GLIBCXX_TEST_THREAD_TRUE = @GLIBCXX_TEST_THREAD_TRUE@ -GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@ -GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ @@ -219,6 +214,9 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ toplevel_srcdir = @toplevel_srcdir@ + +# May be used by various substitution variables. +gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) MAINT_CHARSET = latin1 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs PWD_COMMAND = $${PWDCMD-pwd} @@ -444,12 +442,18 @@ 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 \ diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 2b26fc54d51..35dd364d969 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -151,7 +151,7 @@ namespace std struct _Rep : _Rep_base { // Types: - typedef typename _Alloc::template rebind<char>::other _Raw_bytes_alloc; + typedef typename _Alloc::template rebind<size_type>::other _Raw_alloc; // (Public) Data members: @@ -695,7 +695,10 @@ namespace std reference operator[](size_type __pos) { - _GLIBCXX_DEBUG_ASSERT(__pos < size()); + // allow pos == size() as v3 extension: + _GLIBCXX_DEBUG_ASSERT(__pos <= size()); + // but be strict in pedantic mode: + _GLIBCXX_DEBUG_PEDASSERT(__pos < size()); _M_leak(); return _M_data()[__pos]; } @@ -1905,9 +1908,11 @@ namespace std * * Returns an integer < 0 if this string is ordered before @a str, 0 if * their values are equivalent, or > 0 if this string is ordered after - * @a str. If the lengths of @a str and this string are different, the - * shorter one is ordered first. If they are the same, returns the - * result of traits::compare(data(),str.data(),size()); + * @a str. Determines the effective length rlen of the strings to + * compare as the smallest of size() and str.size(). The function + * then compares the two strings by calling traits::compare(data(), + * str.data(),rlen). If the result of the comparison is nonzero returns + * it, otherwise the shorter one is ordered first. */ int compare(const basic_string& __str) const @@ -1932,10 +1937,12 @@ namespace std * Form the substring of this string from the @a n characters starting * at @a pos. Returns an integer < 0 if the substring is ordered * before @a str, 0 if their values are equivalent, or > 0 if the - * substring is ordered after @a str. If the lengths @a of str and the - * substring are different, the shorter one is ordered first. If they - * are the same, returns the result of - * traits::compare(substring.data(),str.data(),size()); + * substring is ordered after @a str. Determines the effective length + * rlen of the strings to compare as the smallest of the length of the + * substring and @a str.size(). The function then compares the two + * strings by calling traits::compare(substring.data(),str.data(),rlen). + * If the result of the comparison is nonzero returns it, otherwise the + * shorter one is ordered first. */ int compare(size_type __pos, size_type __n, const basic_string& __str) const; @@ -1954,10 +1961,12 @@ namespace std * starting at @a pos2. Returns an integer < 0 if this substring is * ordered before the substring of @a str, 0 if their values are * equivalent, or > 0 if this substring is ordered after the substring - * of @a str. If the lengths of the substring of @a str and this - * substring are different, the shorter one is ordered first. If they - * are the same, returns the result of - * traits::compare(substring.data(),str.substr(pos2,n2).data(),size()); + * of @a str. Determines the effective length rlen of the strings + * to compare as the smallest of the lengths of the substrings. The + * function then compares the two strings by calling + * traits::compare(substring.data(),str.substr(pos2,n2).data(),rlen). + * If the result of the comparison is nonzero returns it, otherwise the + * shorter one is ordered first. */ int compare(size_type __pos1, size_type __n1, const basic_string& __str, @@ -1970,9 +1979,12 @@ namespace std * * Returns an integer < 0 if this string is ordered before @a s, 0 if * their values are equivalent, or > 0 if this string is ordered after - * @a s. If the lengths of @a s and this string are different, the - * shorter one is ordered first. If they are the same, returns the - * result of traits::compare(data(),s,size()); + * @a s. Determines the effective length rlen of the strings to + * compare as the smallest of size() and the length of a string + * constructed from @a s. The function then compares the two strings + * by calling traits::compare(data(),s,rlen). If the result of the + * comparison is nonzero returns it, otherwise the shorter one is + * ordered first. */ int compare(const _CharT* __s) const; @@ -1989,10 +2001,13 @@ namespace std * Form the substring of this string from the @a n1 characters starting * at @a pos. Returns an integer < 0 if the substring is ordered * before @a s, 0 if their values are equivalent, or > 0 if the - * substring is ordered after @a s. If the lengths of @a s and the - * substring are different, the shorter one is ordered first. If they - * are the same, returns the result of - * traits::compare(substring.data(),s,size()); + * substring is ordered after @a s. Determines the effective length + * rlen of the strings to compare as the smallest of the length of the + * substring and the length of a string constructed from @a s. The + * function then compares the two string by calling + * traits::compare(substring.data(),s,rlen). If the result of the + * comparison is nonzero returns it, otherwise the shorter one is + * ordered first. */ int compare(size_type __pos, size_type __n1, const _CharT* __s) const; @@ -2009,10 +2024,12 @@ namespace std * at @a pos1. Form a string from the first @a n2 characters of @a s. * Returns an integer < 0 if this substring is ordered before the string * from @a s, 0 if their values are equivalent, or > 0 if this substring - * is ordered after the string from @a s. If the lengths of this - * substring and @a n2 are different, the shorter one is ordered first. - * If they are the same, returns the result of - * traits::compare(substring.data(),s,size()); + * is ordered after the string from @a s. Determines the effective + * length rlen of the strings to compare as the smallest of the length + * of the substring and @a n2. The function then compares the two + * strings by calling traits::compare(substring.data(),s,rlen). If the + * result of the comparison is nonzero returns it, otherwise the shorter + * one is ordered first. * * NB: s must have at least n2 characters, '\0' has no special * meaning. diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 41db0dff438..672457f9be9 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -425,9 +425,10 @@ namespace std basic_string<_CharT, _Traits, _Alloc>::_Rep:: _M_destroy(const _Alloc& __a) throw () { - const size_type __size = sizeof(_Rep_base) + - (this->_M_capacity + 1) * sizeof(_CharT); - _Raw_bytes_alloc(__a).deallocate(reinterpret_cast<char*>(this), __size); + const size_type __size = ((this->_M_capacity + 1) * sizeof(_CharT) + + sizeof(_Rep_base) + sizeof(size_type) - 1); + _Raw_alloc(__a).deallocate(reinterpret_cast<size_type*>(this), __size + / sizeof(size_type)); } template<typename _CharT, typename _Traits, typename _Alloc> @@ -568,9 +569,12 @@ namespace std __capacity = 2 * __old_capacity; // NB: Need an array of char_type[__capacity], plus a terminating - // null char_type() element, plus enough for the _Rep data structure. + // null char_type() element, plus enough for the _Rep data structure, + // plus sizeof(size_type) - 1 to upper round to a size multiple + // of sizeof(size_type). // Whew. Seemingly so needy, yet so elemental. - size_type __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); + size_type __size = ((__capacity + 1) * sizeof(_CharT) + sizeof(_Rep) + + sizeof(size_type) - 1); const size_type __adj_size = __size + __malloc_header_size; if (__adj_size > __pagesize && __capacity > __old_capacity) @@ -580,12 +584,14 @@ namespace std // Never allocate a string bigger than _S_max_size. if (__capacity > _S_max_size) __capacity = _S_max_size; - __size = (__capacity + 1) * sizeof(_CharT) + sizeof(_Rep); + __size = ((__capacity + 1) * sizeof(_CharT) + sizeof(_Rep) + + sizeof(size_type) - 1); } // NB: Might throw, but no worries about a leak, mate: _Rep() // does not throw. - void* __place = _Raw_bytes_alloc(__alloc).allocate(__size); + void* __place = _Raw_alloc(__alloc).allocate(__size + / sizeof(size_type)); _Rep *__p = new (__place) _Rep; __p->_M_capacity = __capacity; return __p; diff --git a/libstdc++-v3/include/bits/cpp_type_traits.h b/libstdc++-v3/include/bits/cpp_type_traits.h index 367a9d30552..e3887196429 100644 --- a/libstdc++-v3/include/bits/cpp_type_traits.h +++ b/libstdc++-v3/include/bits/cpp_type_traits.h @@ -103,10 +103,12 @@ namespace std struct __truth_type<true> { typedef __true_type __type; }; + // N.B. The conversions to bool are needed due to the issue + // explained in c++/19404. template<class _Sp, class _Tp> struct __traitor { - enum { __value = _Sp::__value || _Tp::__value }; + enum { __value = bool(_Sp::__value) || bool(_Tp::__value) }; typedef typename __truth_type<__value>::__type __type; }; diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc index 0c57bd53a11..c5440b22419 100644 --- a/libstdc++-v3/include/bits/deque.tcc +++ b/libstdc++-v3/include/bits/deque.tcc @@ -1,6 +1,6 @@ // Deque implementation (out of line) -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -203,7 +203,7 @@ namespace _GLIBCXX_STD void deque<_Tp, _Alloc> ::_M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag) + std::input_iterator_tag) { iterator __cur = begin(); for (; __first != __last && __cur != end(); ++__cur, ++__first) @@ -287,7 +287,7 @@ namespace _GLIBCXX_STD void deque<_Tp, _Alloc>:: _M_range_initialize(_InputIterator __first, _InputIterator __last, - input_iterator_tag) + std::input_iterator_tag) { this->_M_initialize_map(0); try @@ -307,7 +307,7 @@ namespace _GLIBCXX_STD void deque<_Tp, _Alloc>:: _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) + std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); this->_M_initialize_map(__n); @@ -417,7 +417,7 @@ namespace _GLIBCXX_STD deque<_Tp, _Alloc>:: _M_range_insert_aux(iterator __pos, _InputIterator __first, _InputIterator __last, - input_iterator_tag) + std::input_iterator_tag) { std::copy(__first, __last, std::inserter(*this, __pos)); } template <typename _Tp, typename _Alloc> @@ -426,7 +426,7 @@ namespace _GLIBCXX_STD deque<_Tp, _Alloc>:: _M_range_insert_aux(iterator __pos, _ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) + std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); if (__pos._M_cur == this->_M_impl._M_start._M_cur) diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index a9d157403fe..40bf428e2c1 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -171,7 +171,15 @@ namespace std // For a stateful encoding (-1) the pending sequence might be just // shift and unshift prefixes with no actual character. __ret = this->egptr() - this->gptr(); + +#if _GLIBCXX_HAVE_DOS_BASED_FILESYSTEM + // About this workaround, see libstdc++/20806. + const bool __testbinary = _M_mode & ios_base::binary; + if (__check_facet(_M_codecvt).encoding() >= 0 + && __testbinary) +#else if (__check_facet(_M_codecvt).encoding() >= 0) +#endif __ret += _M_file.showmanyc() / _M_codecvt->max_length(); } return __ret; @@ -521,8 +529,8 @@ namespace std // future: when __n > __buflen we read directly instead of using the // buffer repeatedly. const bool __testin = _M_mode & ios_base::in; - const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 - : 1; + const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1; + if (__n > __buflen && __check_facet(_M_codecvt).always_noconv() && __testin && !_M_writing) { @@ -540,13 +548,28 @@ namespace std __n -= __avail; } - const streamsize __len = _M_file.xsgetn(reinterpret_cast<char*>(__s), - __n); - if (__len == -1) - __throw_ios_failure(__N("basic_filebuf::xsgetn " - "error reading the file")); - __ret += __len; - if (__len == __n) + // Need to loop in case of short reads (relatively common + // with pipes). + streamsize __len; + for (;;) + { + __len = _M_file.xsgetn(reinterpret_cast<char*>(__s), + __n); + if (__len == -1) + __throw_ios_failure(__N("basic_filebuf::xsgetn " + "error reading the file")); + if (__len == 0) + break; + + __n -= __len; + __ret += __len; + if (__n == 0) + break; + + __s += __len; + } + + if (__n == 0) { _M_set_buffer(0); _M_reading = true; diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index ae3a102ff44..ff54c93ed93 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -1,6 +1,6 @@ // Locale support -*- 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 @@ -277,7 +277,7 @@ namespace std ios_base::iostate& __err, string& __xtrc) const { typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -440,6 +440,20 @@ namespace std return __beg; } + template<typename _ValueT> + struct __to_unsigned_type + { typedef _ValueT __type; }; + + template<> + struct __to_unsigned_type<long> + { typedef unsigned long __type; }; + +#ifdef _GLIBCXX_USE_LONG_LONG + template<> + struct __to_unsigned_type<long long> + { typedef unsigned long long __type; }; +#endif + template<typename _CharT, typename _InIter> template<typename _ValueT> _InIter @@ -447,8 +461,9 @@ namespace std _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io, ios_base::iostate& __err, _ValueT& __v) const { - typedef char_traits<_CharT> __traits_type; - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef char_traits<_CharT> __traits_type; + typedef typename __to_unsigned_type<_ValueT>::__type __unsigned_type; + typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -536,103 +551,56 @@ namespace std __found_grouping.reserve(32); int __sep_pos = 0; bool __overflow = false; - _ValueT __result = 0; + const __unsigned_type __max = __negative ? + -numeric_limits<_ValueT>::min() : numeric_limits<_ValueT>::max(); + const __unsigned_type __smax = __max / __base; + __unsigned_type __result = 0; const char_type* __q; const char_type* __lit_zero = __lit + __num_base::_S_izero; - if (__negative) + while (!__testeof) { - const _ValueT __min = numeric_limits<_ValueT>::min() / __base; - while (!__testeof) + // According to 22.2.2.1.2, p8-9, first look for thousands_sep + // and decimal_point. + if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) { - // According to 22.2.2.1.2, p8-9, first look for thousands_sep - // and decimal_point. - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) + // NB: Thousands separator at the beginning of a string + // is a no-no, as is two consecutive thousands separators. + if (__sep_pos) { - // NB: Thousands separator at the beginning of a string - // is a no-no, as is two consecutive thousands separators. - if (__sep_pos) - { - __found_grouping += static_cast<char>(__sep_pos); - __sep_pos = 0; - } - else - { - __err |= ios_base::failbit; - break; - } + __found_grouping += static_cast<char>(__sep_pos); + __sep_pos = 0; } - else if (__c == __lc->_M_decimal_point) - break; - else if ((__q = __traits_type::find(__lit_zero, __len, __c))) + else { - int __digit = __q - __lit_zero; - if (__digit > 15) - __digit -= 6; - if (__result < __min) - __overflow = true; - else - { - const _ValueT __new_result = (__result * __base - - __digit); - __overflow |= __new_result > __result; - __result = __new_result; - ++__sep_pos; - } + __err |= ios_base::failbit; + break; } - else - // Not a valid input item. - break; - - if (++__beg != __end) - __c = *__beg; - else - __testeof = true; } - } - else - { - const _ValueT __max = numeric_limits<_ValueT>::max() / __base; - while (!__testeof) + else if (__c == __lc->_M_decimal_point) + break; + else if ((__q = __traits_type::find(__lit_zero, __len, __c))) { - if (__lc->_M_use_grouping && __c == __lc->_M_thousands_sep) - { - if (__sep_pos) - { - __found_grouping += static_cast<char>(__sep_pos); - __sep_pos = 0; - } - else - { - __err |= ios_base::failbit; - break; - } - } - else if (__c == __lc->_M_decimal_point) - break; - else if ((__q = __traits_type::find(__lit_zero, __len, __c))) + int __digit = __q - __lit_zero; + if (__digit > 15) + __digit -= 6; + if (__result > __smax) + __overflow = true; + else { - int __digit = __q - __lit_zero; - if (__digit > 15) - __digit -= 6; - if (__result > __max) - __overflow = true; - else - { - const _ValueT __new_result = (__result * __base - + __digit); - __overflow |= __new_result < __result; - __result = __new_result; - ++__sep_pos; - } + __result *= __base; + __overflow |= __result > __max - __digit; + __result += __digit; + ++__sep_pos; } - else - break; - - if (++__beg != __end) - __c = *__beg; - else - __testeof = true; } + else + // Not a valid input item. + break; + + if (++__beg != __end) + __c = *__beg; + else + __testeof = true; } // Digit grouping is checked. If grouping and found_grouping don't @@ -650,7 +618,7 @@ namespace std if (!(__err & ios_base::failbit) && !__overflow && (__sep_pos || __found_zero || __found_grouping.size())) - __v = __result; + __v = __negative ? -__result : __result; else __err |= ios_base::failbit; @@ -682,7 +650,7 @@ namespace std else { // Parse bool values as alphanumeric. - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -853,24 +821,16 @@ namespace std ios_base::fmtflags __flags) { unsigned long __ul = static_cast<unsigned long>(__v); - bool __neg = false; if (__v < 0) - { - __ul = -__ul; - __neg = true; - } - return __int_to_char(__bufend, __ul, __lit, __flags, __neg); + __ul = -__ul; + return __int_to_char(__bufend, __ul, __lit, __flags, false); } template<typename _CharT> inline int __int_to_char(_CharT* __bufend, unsigned long __v, const _CharT* __lit, ios_base::fmtflags __flags) - { - // About showpos, see Table 60 and C99 7.19.6.1, p6 (+). - return __int_to_char(__bufend, __v, __lit, - __flags & ~ios_base::showpos, false); - } + { return __int_to_char(__bufend, __v, __lit, __flags, false); } #ifdef _GLIBCXX_USE_LONG_LONG template<typename _CharT> @@ -879,59 +839,47 @@ namespace std ios_base::fmtflags __flags) { unsigned long long __ull = static_cast<unsigned long long>(__v); - bool __neg = false; if (__v < 0) - { - __ull = -__ull; - __neg = true; - } - return __int_to_char(__bufend, __ull, __lit, __flags, __neg); + __ull = -__ull; + return __int_to_char(__bufend, __ull, __lit, __flags, false); } template<typename _CharT> inline int __int_to_char(_CharT* __bufend, unsigned long long __v, const _CharT* __lit, ios_base::fmtflags __flags) - { return __int_to_char(__bufend, __v, __lit, - __flags & ~ios_base::showpos, false); } + { return __int_to_char(__bufend, __v, __lit, __flags, false); } #endif + // N.B. The last argument is currently unused (see libstdc++/20914). template<typename _CharT, typename _ValueT> int __int_to_char(_CharT* __bufend, _ValueT __v, const _CharT* __lit, - ios_base::fmtflags __flags, bool __neg) + ios_base::fmtflags __flags, bool) { - // Don't write base if already 0. - const bool __showbase = (__flags & ios_base::showbase) && __v; const ios_base::fmtflags __basefield = __flags & ios_base::basefield; - _CharT* __buf = __bufend - 1; + _CharT* __buf = __bufend; - if (__builtin_expect(__basefield != ios_base::oct && - __basefield != ios_base::hex, true)) + if (__builtin_expect(__basefield != ios_base::oct + && __basefield != ios_base::hex, true)) { // Decimal. do { - *__buf-- = __lit[(__v % 10) + __num_base::_S_odigits]; + *--__buf = __lit[(__v % 10) + __num_base::_S_odigits]; __v /= 10; } while (__v != 0); - if (__neg) - *__buf-- = __lit[__num_base::_S_ominus]; - else if (__flags & ios_base::showpos) - *__buf-- = __lit[__num_base::_S_oplus]; } else if (__basefield == ios_base::oct) { // Octal. do { - *__buf-- = __lit[(__v & 0x7) + __num_base::_S_odigits]; + *--__buf = __lit[(__v & 0x7) + __num_base::_S_odigits]; __v >>= 3; } while (__v != 0); - if (__showbase) - *__buf-- = __lit[__num_base::_S_odigits]; } else { @@ -941,53 +889,25 @@ namespace std : __num_base::_S_odigits; do { - *__buf-- = __lit[(__v & 0xf) + __case_offset]; + *--__buf = __lit[(__v & 0xf) + __case_offset]; __v >>= 4; } while (__v != 0); - if (__showbase) - { - // 'x' or 'X' - *__buf-- = __lit[__num_base::_S_ox + __uppercase]; - // '0' - *__buf-- = __lit[__num_base::_S_odigits]; - } } - return __bufend - __buf - 1; + return __bufend - __buf; } template<typename _CharT, typename _OutIter> void num_put<_CharT, _OutIter>:: _M_group_int(const char* __grouping, size_t __grouping_size, _CharT __sep, - ios_base& __io, _CharT* __new, _CharT* __cs, int& __len) const + ios_base&, _CharT* __new, _CharT* __cs, int& __len) const { - // By itself __add_grouping cannot deal correctly with __cs when - // ios::showbase is set and ios_base::oct || ios_base::hex. - // Therefore we take care "by hand" of the initial 0, 0x or 0X. - // However, remember that the latter do not occur if the number - // printed is '0' (__len == 1). - streamsize __off = 0; - const ios_base::fmtflags __basefield = __io.flags() - & ios_base::basefield; - if ((__io.flags() & ios_base::showbase) && __len > 1) - if (__basefield == ios_base::oct) - { - __off = 1; - __new[0] = __cs[0]; - } - else if (__basefield == ios_base::hex) - { - __off = 2; - __new[0] = __cs[0]; - __new[1] = __cs[1]; - } - _CharT* __p = std::__add_grouping(__new + __off, __sep, __grouping, - __grouping_size, __cs + __off, - __cs + __len); + _CharT* __p = std::__add_grouping(__new, __sep, __grouping, + __grouping_size, __cs, __cs + __len); __len = __p - __new; } - + template<typename _CharT, typename _OutIter> template<typename _ValueT> _OutIter @@ -995,33 +915,69 @@ namespace std _M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill, _ValueT __v) const { - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); const _CharT* __lit = __lc->_M_atoms_out; + const ios_base::fmtflags __flags = __io.flags(); // Long enough to hold hex, dec, and octal representations. - const int __ilen = 4 * sizeof(_ValueT); + const int __ilen = 5 * sizeof(_ValueT); _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __ilen)); // [22.2.2.2.2] Stage 1, numeric conversion to character. // Result is returned right-justified in the buffer. - int __len; - __len = __int_to_char(__cs + __ilen, __v, __lit, __io.flags()); + int __len = __int_to_char(__cs + __ilen, __v, __lit, __flags); __cs += __ilen - __len; // Add grouping, if necessary. if (__lc->_M_use_grouping) { - // Grouping can add (almost) as many separators as the - // number of digits, but no more. + // Grouping can add (almost) as many separators as the number + // of digits + space is reserved for numeric base or sign. _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len * 2)); + * (__len + 1) + * 2)); _M_group_int(__lc->_M_grouping, __lc->_M_grouping_size, - __lc->_M_thousands_sep, __io, __cs2, __cs, __len); - __cs = __cs2; + __lc->_M_thousands_sep, __io, __cs2 + 2, __cs, __len); + __cs = __cs2 + 2; + } + + // Complete Stage 1, prepend numeric base or sign. + const ios_base::fmtflags __basefield = __flags & ios_base::basefield; + if (__builtin_expect(__basefield != ios_base::oct + && __basefield != ios_base::hex, true)) + { + // Decimal. + if (__v > 0) + { + if (__flags & ios_base::showpos + && numeric_limits<_ValueT>::is_signed) + *--__cs = __lit[__num_base::_S_oplus], ++__len; + } + else if (__v) + *--__cs = __lit[__num_base::_S_ominus], ++__len; + } + else if (__basefield == ios_base::oct) + { + // Octal. + if (__flags & ios_base::showbase && __v) + *--__cs = __lit[__num_base::_S_odigits], ++__len; + } + else + { + // Hex. + if (__flags & ios_base::showbase && __v) + { + // 'x' or 'X' + const bool __uppercase = __flags & ios_base::uppercase; + *--__cs = __lit[__num_base::_S_ox + __uppercase]; + // '0' + *--__cs = __lit[__num_base::_S_odigits]; + __len += 2; + } } // Pad. @@ -1082,7 +1038,7 @@ namespace std _M_insert_float(_OutIter __s, ios_base& __io, _CharT __fill, char __mod, _ValueT __v) const { - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -1137,49 +1093,65 @@ namespace std _S_get_c_locale(), __prec); #endif - // [22.2.2.2.2] Stage 2, convert to char_type, using correct - // numpunct.decimal_point() values for '.' and adding grouping. - const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); - - _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len)); - __ctype.widen(__cs, __cs + __len, __ws); - - // Replace decimal point. - const _CharT __cdec = __ctype.widen('.'); - const _CharT __dec = __lc->_M_decimal_point; - const _CharT* __p = char_traits<_CharT>::find(__ws, __len, __cdec); - if (__p) - __ws[__p - __ws] = __dec; - - // Add grouping, if necessary. - if (__lc->_M_use_grouping) - { - // Grouping can add (almost) as many separators as the - // number of digits, but no more. - _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __len * 2)); - _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size, - __lc->_M_thousands_sep, __p, __ws2, __ws, __len); - __ws = __ws2; - } - - // Pad. - const streamsize __w = __io.width(); - if (__w > static_cast<streamsize>(__len)) - { - _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) - * __w)); - _M_pad(__fill, __w, __io, __ws3, __ws, __len); - __ws = __ws3; - } - __io.width(0); + // [22.2.2.2.2] Stage 2, convert to char_type, using correct + // numpunct.decimal_point() values for '.' and adding grouping. + const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); + + _CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + * __len)); + __ctype.widen(__cs, __cs + __len, __ws); + + // Replace decimal point. + const _CharT __cdec = __ctype.widen('.'); + const _CharT __dec = __lc->_M_decimal_point; + const _CharT* __p = char_traits<_CharT>::find(__ws, __len, __cdec); + if (__p) + __ws[__p - __ws] = __dec; + + // Add grouping, if necessary. + // N.B. Make sure to not group things like 2e20, i.e., no decimal + // point, scientific notation. + if (__lc->_M_use_grouping + && (__p || __len < 3 || (__cs[1] <= '9' && __cs[2] <= '9' + && __cs[1] >= '0' && __cs[2] >= '0'))) + { + // Grouping can add (almost) as many separators as the + // number of digits, but no more. + _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + * __len * 2)); + + streamsize __off = 0; + if (__cs[0] == '-' || __cs[0] == '+') + { + __off = 1; + __ws2[0] = __ws[0]; + __len -= 1; + } + + _M_group_float(__lc->_M_grouping, __lc->_M_grouping_size, + __lc->_M_thousands_sep, __p, __ws2 + __off, + __ws + __off, __len); + __len += __off; + + __ws = __ws2; + } - // [22.2.2.2.2] Stage 4. - // Write resulting, fully-formatted string to output iterator. - return std::__write(__s, __ws, __len); + // Pad. + const streamsize __w = __io.width(); + if (__w > static_cast<streamsize>(__len)) + { + _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) + * __w)); + _M_pad(__fill, __w, __io, __ws3, __ws, __len); + __ws = __ws3; + } + __io.width(0); + + // [22.2.2.2.2] Stage 4. + // Write resulting, fully-formatted string to output iterator. + return std::__write(__s, __ws, __len); } - + template<typename _CharT, typename _OutIter> _OutIter num_put<_CharT, _OutIter>:: @@ -1193,7 +1165,7 @@ namespace std } else { - typedef typename numpunct<_CharT>::__cache_type __cache_type; + typedef __numpunct_cache<_CharT> __cache_type; __use_cache<__cache_type> __uc; const locale& __loc = __io._M_getloc(); const __cache_type* __lc = __uc(__loc); @@ -1287,8 +1259,7 @@ namespace std typedef char_traits<_CharT> __traits_type; typedef typename string_type::size_type size_type; typedef money_base::part part; - typedef moneypunct<_CharT, _Intl> __moneypunct_type; - typedef typename __moneypunct_type::__cache_type __cache_type; + typedef __moneypunct_cache<_CharT, _Intl> __cache_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); @@ -1546,8 +1517,7 @@ namespace std { typedef typename string_type::size_type size_type; typedef money_base::part part; - typedef moneypunct<_CharT, _Intl> __moneypunct_type; - typedef typename __moneypunct_type::__cache_type __cache_type; + typedef __moneypunct_cache<_CharT, _Intl> __cache_type; const locale& __loc = __io._M_getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); @@ -1563,7 +1533,7 @@ namespace std money_base::pattern __p; const char_type* __sign; size_type __sign_size; - if (*__beg != __lit[money_base::_S_minus]) + if (!(*__beg == __lit[money_base::_S_minus])) { __p = __lc->_M_pos_format; __sign = __lc->_M_positive_sign; @@ -2048,7 +2018,7 @@ namespace std for (size_t __i3 = 0; __i3 < __nmatches;) { __name = __names[__matches[__i3]]; - if (__name[__pos] != *__beg) + if (!(__name[__pos] == *__beg)) __matches[__i3] = __matches[--__nmatches]; else ++__i3; diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h index f568a0671e3..c0eaf5cd516 100644 --- a/libstdc++-v3/include/bits/stl_algo.h +++ b/libstdc++-v3/include/bits/stl_algo.h @@ -1736,7 +1736,8 @@ namespace std __glibcxx_requires_valid_range(__first, __middle); __glibcxx_requires_valid_range(__middle, __last); - return std::copy(__first, __middle, copy(__middle, __last, __result)); + return std::copy(__first, __middle, + std::copy(__middle, __last, __result)); } /** @@ -2211,10 +2212,10 @@ namespace std __final_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last) { - if (__last - __first > _S_threshold) + if (__last - __first > int(_S_threshold)) { - std::__insertion_sort(__first, __first + _S_threshold); - std::__unguarded_insertion_sort(__first + _S_threshold, __last); + std::__insertion_sort(__first, __first + int(_S_threshold)); + std::__unguarded_insertion_sort(__first + int(_S_threshold), __last); } else std::__insertion_sort(__first, __last); @@ -2230,10 +2231,10 @@ namespace std __final_insertion_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { - if (__last - __first > _S_threshold) + if (__last - __first > int(_S_threshold)) { - std::__insertion_sort(__first, __first + _S_threshold, __comp); - std::__unguarded_insertion_sort(__first + _S_threshold, __last, + std::__insertion_sort(__first, __first + int(_S_threshold), __comp); + std::__unguarded_insertion_sort(__first + int(_S_threshold), __last, __comp); } else @@ -2480,7 +2481,7 @@ namespace std typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; - while (__last - __first > _S_threshold) + while (__last - __first > int(_S_threshold)) { if (__depth_limit == 0) { @@ -2516,7 +2517,7 @@ namespace std typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType; - while (__last - __first > _S_threshold) + while (__last - __first > int(_S_threshold)) { if (__depth_limit == 0) { 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/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 74985071baa..bdd21559fb9 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -106,7 +106,8 @@ namespace _GLIBCXX_STD { *_M_p ^= _M_mask; } }; - struct _Bit_iterator_base : public iterator<random_access_iterator_tag, bool> + struct _Bit_iterator_base + : public std::iterator<std::random_access_iterator_tag, bool> { _Bit_type * _M_p; unsigned int _M_offset; @@ -117,7 +118,7 @@ namespace _GLIBCXX_STD void _M_bump_up() { - if (_M_offset++ == _S_word_bit - 1) + if (_M_offset++ == int(_S_word_bit) - 1) { _M_offset = 0; ++_M_p; @@ -129,7 +130,7 @@ namespace _GLIBCXX_STD { if (_M_offset-- == 0) { - _M_offset = _S_word_bit - 1; + _M_offset = int(_S_word_bit) - 1; --_M_p; } } @@ -138,11 +139,11 @@ namespace _GLIBCXX_STD _M_incr(ptrdiff_t __i) { difference_type __n = __i + _M_offset; - _M_p += __n / _S_word_bit; - __n = __n % _S_word_bit; + _M_p += __n / int(_S_word_bit); + __n = __n % int(_S_word_bit); if (__n < 0) { - _M_offset = static_cast<unsigned int>(__n + _S_word_bit); + _M_offset = static_cast<unsigned int>(__n + int(_S_word_bit)); --_M_p; } else @@ -180,7 +181,8 @@ namespace _GLIBCXX_STD inline ptrdiff_t operator-(const _Bit_iterator_base& __x, const _Bit_iterator_base& __y) { - return _S_word_bit * (__x._M_p - __y._M_p) + __x._M_offset - __y._M_offset; + return (int(_S_word_bit) * (__x._M_p - __y._M_p) + + __x._M_offset - __y._M_offset); } struct _Bit_iterator : public _Bit_iterator_base @@ -384,7 +386,8 @@ namespace _GLIBCXX_STD _Bit_type* _M_allocate(size_t __n) - { return _M_impl.allocate((__n + _S_word_bit - 1) / _S_word_bit); } + { return _M_impl.allocate((__n + int(_S_word_bit) - 1) + / int(_S_word_bit)); } void _M_deallocate() @@ -452,8 +455,8 @@ template<typename _Alloc> { _Bit_type* __q = this->_M_allocate(__n); this->_M_impl._M_end_of_storage = (__q - + ((__n + _S_word_bit - 1) - / _S_word_bit)); + + ((__n + int(_S_word_bit) - 1) + / int(_S_word_bit))); this->_M_impl._M_start = iterator(__q, 0); this->_M_impl._M_finish = this->_M_impl._M_start + difference_type(__n); } @@ -477,8 +480,9 @@ template<typename _Alloc> *__i++ = __x; this->_M_impl._M_finish = std::copy(__position, end(), __i); this->_M_deallocate(); - this->_M_impl._M_end_of_storage = (__q + ((__len + _S_word_bit - 1) - / _S_word_bit)); + this->_M_impl._M_end_of_storage = (__q + ((__len + + int(_S_word_bit) - 1) + / int(_S_word_bit))); this->_M_impl._M_start = iterator(__q, 0); } } @@ -486,7 +490,7 @@ template<typename _Alloc> template<class _InputIterator> void _M_initialize_range(_InputIterator __first, _InputIterator __last, - input_iterator_tag) + std::input_iterator_tag) { this->_M_impl._M_start = iterator(); this->_M_impl._M_finish = iterator(); @@ -498,7 +502,7 @@ template<typename _Alloc> template<class _ForwardIterator> void _M_initialize_range(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) + std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); _M_initialize(__n); @@ -508,7 +512,7 @@ template<typename _Alloc> template<class _InputIterator> void _M_insert_range(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag) + _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) { @@ -520,7 +524,7 @@ template<typename _Alloc> template<class _ForwardIterator> void _M_insert_range(iterator __position, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag) + _ForwardIterator __last, std::forward_iterator_tag) { if (__first != __last) { @@ -543,8 +547,9 @@ template<typename _Alloc> this->_M_impl._M_finish = std::copy(__position, end(), __i); this->_M_deallocate(); this->_M_impl._M_end_of_storage = (__q - + ((__len + _S_word_bit - 1) - / _S_word_bit)); + + ((__len + + int(_S_word_bit) - 1) + / int(_S_word_bit))); this->_M_impl._M_start = iterator(__q, 0); } } @@ -742,7 +747,7 @@ template<typename _Alloc> template<class _InputIterator> void _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag) + std::input_iterator_tag) { iterator __cur = begin(); for (; __first != __last && __cur != end(); ++__cur, ++__first) @@ -756,7 +761,7 @@ template<typename _Alloc> template<class _ForwardIterator> void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) + std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); if (__len < size()) @@ -782,8 +787,8 @@ template<typename _Alloc> iterator(__q, 0)); this->_M_deallocate(); this->_M_impl._M_start = iterator(__q, 0); - this->_M_impl._M_end_of_storage = (__q + (__n + _S_word_bit - 1) - / _S_word_bit); + this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1) + / int(_S_word_bit)); } } @@ -888,8 +893,9 @@ template<typename _Alloc> this->_M_impl._M_finish = std::copy(__position, end(), __i + difference_type(__n)); this->_M_deallocate(); - this->_M_impl._M_end_of_storage = (__q + ((__len + _S_word_bit - 1) - / _S_word_bit)); + this->_M_impl._M_end_of_storage = (__q + ((__len + + int(_S_word_bit) - 1) + / int(_S_word_bit))); this->_M_impl._M_start = iterator(__q, 0); } } diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 27d0304ba04..fdee3d5aedf 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -106,14 +106,14 @@ namespace _GLIBCXX_STD static size_t _S_buffer_size() { return __deque_buf_size(sizeof(_Tp)); } - typedef random_access_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Ptr pointer; - typedef _Ref reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef _Tp** _Map_pointer; - typedef _Deque_iterator _Self; + typedef std::random_access_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Ptr pointer; + typedef _Ref reference; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp** _Map_pointer; + typedef _Deque_iterator _Self; _Tp* _M_cur; _Tp* _M_first; @@ -591,7 +591,7 @@ namespace _GLIBCXX_STD * and we can use other standard algorithms as well. * @endif */ - template<typename _Tp, typename _Alloc = allocator<_Tp> > + template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class deque : protected _Deque_base<_Tp, _Alloc> { // concept requirements @@ -1214,8 +1214,8 @@ namespace _GLIBCXX_STD _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; + typedef typename std::iterator_traits<_InputIterator>:: + iterator_category _IterCategory; _M_range_initialize(__first, __last, _IterCategory()); } @@ -1236,13 +1236,13 @@ namespace _GLIBCXX_STD template<typename _InputIterator> void _M_range_initialize(_InputIterator __first, _InputIterator __last, - input_iterator_tag); + std::input_iterator_tag); // called by the second initialize_dispatch above template<typename _ForwardIterator> void _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag); + std::forward_iterator_tag); //@} /** @@ -1278,8 +1278,8 @@ namespace _GLIBCXX_STD _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; + typedef typename std::iterator_traits<_InputIterator>:: + iterator_category _IterCategory; _M_assign_aux(__first, __last, _IterCategory()); } @@ -1287,13 +1287,13 @@ namespace _GLIBCXX_STD template<typename _InputIterator> void _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag); + std::input_iterator_tag); // called by the second assign_dispatch above template<typename _ForwardIterator> void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) + std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); if (__len > size()) @@ -1356,8 +1356,8 @@ namespace _GLIBCXX_STD _InputIterator __first, _InputIterator __last, __false_type) { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; + typedef typename std::iterator_traits<_InputIterator>:: + iterator_category _IterCategory; _M_range_insert_aux(__pos, __first, __last, _IterCategory()); } @@ -1365,13 +1365,13 @@ namespace _GLIBCXX_STD template<typename _InputIterator> void _M_range_insert_aux(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag); + _InputIterator __last, std::input_iterator_tag); // called by the second insert_dispatch above template<typename _ForwardIterator> void _M_range_insert_aux(iterator __pos, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag); + _ForwardIterator __last, std::forward_iterator_tag); // Called by insert(p,n,x), and the range insert when it turns out to be // the same thing. Can use fill functions in optimal situations, diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index b928e00515b..ce167ef80e4 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -110,14 +110,14 @@ namespace _GLIBCXX_STD template<typename _Tp> struct _List_iterator { - typedef _List_iterator<_Tp> _Self; - typedef _List_node<_Tp> _Node; + typedef _List_iterator<_Tp> _Self; + typedef _List_node<_Tp> _Node; - typedef ptrdiff_t difference_type; - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef _Tp* pointer; - typedef _Tp& reference; + typedef ptrdiff_t difference_type; + typedef std::bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef _Tp* pointer; + typedef _Tp& reference; _List_iterator() : _M_node() { } @@ -186,15 +186,15 @@ namespace _GLIBCXX_STD template<typename _Tp> struct _List_const_iterator { - typedef _List_const_iterator<_Tp> _Self; - typedef const _List_node<_Tp> _Node; - typedef _List_iterator<_Tp> iterator; + typedef _List_const_iterator<_Tp> _Self; + typedef const _List_node<_Tp> _Node; + typedef _List_iterator<_Tp> iterator; - typedef ptrdiff_t difference_type; - typedef bidirectional_iterator_tag iterator_category; - typedef _Tp value_type; - typedef const _Tp* pointer; - typedef const _Tp& reference; + typedef ptrdiff_t difference_type; + typedef std::bidirectional_iterator_tag iterator_category; + typedef _Tp value_type; + typedef const _Tp* pointer; + typedef const _Tp& reference; _List_const_iterator() : _M_node() { } @@ -387,7 +387,7 @@ namespace _GLIBCXX_STD * iterator's next/previous pointers refer to itself, the %list is * %empty. @endif */ - template<typename _Tp, typename _Alloc = allocator<_Tp> > + template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class list : protected _List_base<_Tp, _Alloc> { // concept requirements diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h index 8535ae5f268..a0834a763bc 100644 --- a/libstdc++-v3/include/bits/stl_map.h +++ b/libstdc++-v3/include/bits/stl_map.h @@ -1,6 +1,6 @@ // Map implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -86,8 +86,8 @@ namespace _GLIBCXX_STD * called (*_unique versus *_equal, same as the standard). * @endif */ - template <typename _Key, typename _Tp, typename _Compare = less<_Key>, - typename _Alloc = allocator<pair<const _Key, _Tp> > > + template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>, + typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > > class map { // concept requirements @@ -98,11 +98,11 @@ namespace _GLIBCXX_STD public: typedef _Key key_type; typedef _Tp mapped_type; - typedef pair<const _Key, _Tp> value_type; + typedef std::pair<const _Key, _Tp> value_type; typedef _Compare key_compare; class value_compare - : public binary_function<value_type, value_type, bool> + : public std::binary_function<value_type, value_type, bool> { friend class map<_Key,_Tp,_Compare,_Alloc>; protected: @@ -355,7 +355,7 @@ namespace _GLIBCXX_STD * * Insertion requires logarithmic time. */ - pair<iterator,bool> + std::pair<iterator,bool> insert(const value_type& __x) { return _M_t.insert_unique(__x); } @@ -589,7 +589,7 @@ namespace _GLIBCXX_STD * * This function probably only makes sense for multimaps. */ - pair<iterator,iterator> + std::pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } @@ -608,7 +608,7 @@ namespace _GLIBCXX_STD * * This function probably only makes sense for multimaps. */ - pair<const_iterator,const_iterator> + std::pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h index e080f9aaba7..524b2366813 100644 --- a/libstdc++-v3/include/bits/stl_multimap.h +++ b/libstdc++-v3/include/bits/stl_multimap.h @@ -1,6 +1,6 @@ // Multimap implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -68,8 +68,8 @@ namespace _GLIBCXX_STD // Forward declaration of operators < and ==, needed for friend declaration. template <typename _Key, typename _Tp, - typename _Compare = less<_Key>, - typename _Alloc = allocator<pair<const _Key, _Tp> > > + typename _Compare = std::less<_Key>, + typename _Alloc = std::allocator<std::pair<const _Key, _Tp> > > class multimap; template <typename _Key, typename _Tp, typename _Compare, typename _Alloc> @@ -114,11 +114,11 @@ namespace _GLIBCXX_STD public: typedef _Key key_type; typedef _Tp mapped_type; - typedef pair<const _Key, _Tp> value_type; + typedef std::pair<const _Key, _Tp> value_type; typedef _Compare key_compare; class value_compare - : public binary_function<value_type, value_type, bool> + : public std::binary_function<value_type, value_type, bool> { friend class multimap<_Key,_Tp,_Compare,_Alloc>; protected: @@ -573,7 +573,7 @@ namespace _GLIBCXX_STD * @endcode * (but is faster than making the calls separately). */ - pair<iterator,iterator> + std::pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } @@ -590,7 +590,7 @@ namespace _GLIBCXX_STD * @endcode * (but is faster than making the calls separately). */ - pair<const_iterator,const_iterator> + std::pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h index c82dee68e4e..3f42ef4c38d 100644 --- a/libstdc++-v3/include/bits/stl_multiset.h +++ b/libstdc++-v3/include/bits/stl_multiset.h @@ -1,6 +1,6 @@ // Multiset implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -67,8 +67,8 @@ namespace _GLIBCXX_STD { // Forward declaration of operators < and ==, needed for friend declaration. - template <class _Key, class _Compare = less<_Key>, - class _Alloc = allocator<_Key> > + template <class _Key, class _Compare = std::less<_Key>, + class _Alloc = std::allocator<_Key> > class multiset; template <class _Key, class _Compare, class _Alloc> @@ -492,11 +492,11 @@ namespace _GLIBCXX_STD * * This function probably only makes sense for multisets. */ - pair<iterator,iterator> + std::pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } - pair<const_iterator,const_iterator> + std::pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h index bb28bddc7af..1a15d1172c8 100644 --- a/libstdc++-v3/include/bits/stl_set.h +++ b/libstdc++-v3/include/bits/stl_set.h @@ -1,6 +1,6 @@ // Set implementation -*- C++ -*- -// Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -66,8 +66,8 @@ namespace _GLIBCXX_STD { // Forward declarations of operators < and ==, needed for friend declaration. - template<class _Key, class _Compare = less<_Key>, - class _Alloc = allocator<_Key> > + template<class _Key, class _Compare = std::less<_Key>, + class _Alloc = std::allocator<_Key> > class set; template<class _Key, class _Compare, class _Alloc> @@ -308,11 +308,12 @@ namespace _GLIBCXX_STD * * Insertion requires logarithmic time. */ - pair<iterator,bool> + std::pair<iterator,bool> insert(const value_type& __x) { - pair<typename _Rep_type::iterator, bool> __p = _M_t.insert_unique(__x); - return pair<iterator, bool>(__p.first, __p.second); + std::pair<typename _Rep_type::iterator, bool> __p = + _M_t.insert_unique(__x); + return std::pair<iterator, bool>(__p.first, __p.second); } /** @@ -502,11 +503,11 @@ namespace _GLIBCXX_STD * * This function probably only makes sense for multisets. */ - pair<iterator,iterator> + std::pair<iterator,iterator> equal_range(const key_type& __x) { return _M_t.equal_range(__x); } - pair<const_iterator,const_iterator> + std::pair<const_iterator,const_iterator> equal_range(const key_type& __x) const { return _M_t.equal_range(__x); } //@} diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 3495d9312ae..d532c2dc910 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -144,7 +144,7 @@ namespace _GLIBCXX_STD * memory and size allocation. Subscripting ( @c [] ) access is * also provided as with C-style arrays. */ - template<typename _Tp, typename _Alloc = allocator<_Tp> > + template<typename _Tp, typename _Alloc = std::allocator<_Tp> > class vector : protected _Vector_base<_Tp, _Alloc> { // Concept requirements. @@ -795,8 +795,8 @@ namespace _GLIBCXX_STD _M_initialize_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; + typedef typename std::iterator_traits<_InputIterator>:: + iterator_category _IterCategory; _M_range_initialize(__first, __last, _IterCategory()); } @@ -804,7 +804,7 @@ namespace _GLIBCXX_STD template<typename _InputIterator> void _M_range_initialize(_InputIterator __first, - _InputIterator __last, input_iterator_tag) + _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) push_back(*__first); @@ -814,7 +814,7 @@ namespace _GLIBCXX_STD template<typename _ForwardIterator> void _M_range_initialize(_ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag) + _ForwardIterator __last, std::forward_iterator_tag) { const size_type __n = std::distance(__first, __last); this->_M_impl._M_start = this->_M_allocate(__n); @@ -844,8 +844,8 @@ namespace _GLIBCXX_STD _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type) { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; + typedef typename std::iterator_traits<_InputIterator>:: + iterator_category _IterCategory; _M_assign_aux(__first, __last, _IterCategory()); } @@ -853,13 +853,13 @@ namespace _GLIBCXX_STD template<typename _InputIterator> void _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag); + std::input_iterator_tag); // Called by the second assign_dispatch above template<typename _ForwardIterator> void _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag); + std::forward_iterator_tag); // Called by assign(n,t), and the range assign when it turns out // to be the same thing. @@ -885,8 +885,8 @@ namespace _GLIBCXX_STD _M_insert_dispatch(iterator __pos, _InputIterator __first, _InputIterator __last, __false_type) { - typedef typename iterator_traits<_InputIterator>::iterator_category - _IterCategory; + typedef typename std::iterator_traits<_InputIterator>:: + iterator_category _IterCategory; _M_range_insert(__pos, __first, __last, _IterCategory()); } @@ -894,13 +894,13 @@ namespace _GLIBCXX_STD template<typename _InputIterator> void _M_range_insert(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag); + _InputIterator __last, std::input_iterator_tag); // Called by the second insert_dispatch above template<typename _ForwardIterator> void _M_range_insert(iterator __pos, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag); + _ForwardIterator __last, std::forward_iterator_tag); // Called by insert(p,n,x), and the range insert when it turns out to be // the same thing. diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc index 57144b073bb..f9f5e5ac8a7 100644 --- a/libstdc++-v3/include/bits/vector.tcc +++ b/libstdc++-v3/include/bits/vector.tcc @@ -1,6 +1,6 @@ // Vector implementation (out of line) -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -192,7 +192,7 @@ namespace _GLIBCXX_STD void vector<_Tp, _Alloc>:: _M_assign_aux(_InputIterator __first, _InputIterator __last, - input_iterator_tag) + std::input_iterator_tag) { iterator __cur(begin()); for (; __first != __last && __cur != end(); ++__cur, ++__first) @@ -208,7 +208,7 @@ namespace _GLIBCXX_STD void vector<_Tp, _Alloc>:: _M_assign_aux(_ForwardIterator __first, _ForwardIterator __last, - forward_iterator_tag) + std::forward_iterator_tag) { const size_type __len = std::distance(__first, __last); @@ -392,7 +392,7 @@ namespace _GLIBCXX_STD void vector<_Tp, _Alloc>:: _M_range_insert(iterator __pos, _InputIterator __first, - _InputIterator __last, input_iterator_tag) + _InputIterator __last, std::input_iterator_tag) { for (; __first != __last; ++__first) { @@ -406,7 +406,7 @@ namespace _GLIBCXX_STD void vector<_Tp, _Alloc>:: _M_range_insert(iterator __position, _ForwardIterator __first, - _ForwardIterator __last, forward_iterator_tag) + _ForwardIterator __last, std::forward_iterator_tag) { if (__first != __last) { diff --git a/libstdc++-v3/include/c_std/std_cstdio.h b/libstdc++-v3/include/c_std/std_cstdio.h index f31e58e6f24..57bbb3ddb97 100644 --- a/libstdc++-v3/include/c_std/std_cstdio.h +++ b/libstdc++-v3/include/c_std/std_cstdio.h @@ -154,15 +154,16 @@ namespace __gnu_cxx { #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC extern "C" int - (snprintf)(char * restrict, size_t, const char * restrict, ...); + (snprintf)(char * restrict, size_t, const char * restrict, ...); extern "C" int - (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list); + (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list); extern "C" int (vscanf)(const char * restrict, __gnuc_va_list); extern "C" int - (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list); + (vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list); extern "C" int - (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list); + (vsscanf)(const char * restrict, const char * restrict, __gnuc_va_list); #endif + #if !_GLIBCXX_USE_C99_DYNAMIC using ::snprintf; using ::vfscanf; diff --git a/libstdc++-v3/include/c_std/std_cwctype.h b/libstdc++-v3/include/c_std/std_cwctype.h index 970c53a8f3d..86d0dfdab15 100644 --- a/libstdc++-v3/include/c_std/std_cwctype.h +++ b/libstdc++-v3/include/c_std/std_cwctype.h @@ -1,6 +1,6 @@ // -*- C++ -*- forwarding header. -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -59,19 +59,18 @@ # undef iswblank #endif #undef iswcntrl +#undef iswctype #undef iswdigit #undef iswgraph #undef iswlower #undef iswprint -#undef iswprint #undef iswpunct #undef iswspace #undef iswupper #undef iswxdigit -#undef iswctype +#undef towctrans #undef towlower #undef towupper -#undef towctrans #undef wctrans #undef wctype @@ -89,19 +88,18 @@ namespace std using ::iswblank; #endif using ::iswcntrl; + using ::iswctype; using ::iswdigit; using ::iswgraph; using ::iswlower; using ::iswprint; - using ::iswprint; using ::iswpunct; using ::iswspace; using ::iswupper; using ::iswxdigit; - using ::iswctype; + using ::towctrans; using ::towlower; using ::towupper; - using ::towctrans; using ::wctrans; using ::wctype; } diff --git a/libstdc++-v3/include/debug/bitset b/libstdc++-v3/include/debug/bitset index 2e2364ff930..e292fea3d95 100644 --- a/libstdc++-v3/include/debug/bitset +++ b/libstdc++-v3/include/debug/bitset @@ -1,6 +1,6 @@ // Debugging bitset implementation -*- C++ -*- -// Copyright (C) 2003, 2004 +// Copyright (C) 2003, 2004, 2005 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -239,6 +239,28 @@ namespace __gnu_debug_def to_string() const { return _M_base().template to_string<_CharT, _Traits, _Allocator>(); } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 434. bitset::to_string() hard to use. + template<typename _CharT, typename _Traits> + std::basic_string<_CharT, _Traits, std::allocator<_CharT> > + to_string() const + { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); } + + template<typename _CharT> + std::basic_string<_CharT, std::char_traits<_CharT>, + std::allocator<_CharT> > + to_string() const + { + return to_string<_CharT, std::char_traits<_CharT>, + std::allocator<_CharT> >(); + } + + std::basic_string<char, std::char_traits<char>, std::allocator<char> > + to_string() const + { + return to_string<char,std::char_traits<char>,std::allocator<char> >(); + } + using _Base::count; using _Base::size; diff --git a/libstdc++-v3/include/debug/debug.h b/libstdc++-v3/include/debug/debug.h index 94c89e95fac..f371a6a47ca 100644 --- a/libstdc++-v3/include/debug/debug.h +++ b/libstdc++-v3/include/debug/debug.h @@ -226,7 +226,7 @@ _GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last, _Pred), \ #ifdef _GLIBCXX_DEBUG # define _GLIBCXX_DEBUG_ASSERT(_Condition) assert(_Condition) -# ifdef _GLIBXX_DEBUG_PEDANTIC +# ifdef _GLIBCXX_DEBUG_PEDANTIC # define _GLIBCXX_DEBUG_PEDASSERT(_Condition) assert(_Condition) # else # define _GLIBCXX_DEBUG_PEDASSERT(_Condition) diff --git a/libstdc++-v3/include/debug/formatter.h b/libstdc++-v3/include/debug/formatter.h index db555b0030d..20836cfbb61 100644 --- a/libstdc++-v3/include/debug/formatter.h +++ b/libstdc++-v3/include/debug/formatter.h @@ -1,7 +1,6 @@ // Debug-mode error formatting implementation -*- C++ -*- -// Copyright (C) 2003, 2004 -// Free Software Foundation, Inc. +// Copyright (C) 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 @@ -310,7 +309,7 @@ namespace __gnu_debug const _Error_formatter& _M_iterator(const _Iterator& __it, const char* __name = 0) const { - if (_M_num_parameters < __max_parameters) + if (_M_num_parameters < size_t(__max_parameters)) _M_parameters[_M_num_parameters++] = _Parameter(__it, __name, _Is_iterator()); return *this; @@ -319,7 +318,7 @@ namespace __gnu_debug const _Error_formatter& _M_integer(long __value, const char* __name = 0) const { - if (_M_num_parameters < __max_parameters) + if (_M_num_parameters < size_t(__max_parameters)) _M_parameters[_M_num_parameters++] = _Parameter(__value, __name); return *this; } @@ -327,7 +326,7 @@ namespace __gnu_debug const _Error_formatter& _M_string(const char* __value, const char* __name = 0) const { - if (_M_num_parameters < __max_parameters) + if (_M_num_parameters < size_t(__max_parameters)) _M_parameters[_M_num_parameters++] = _Parameter(__value, __name); return *this; } @@ -336,7 +335,7 @@ namespace __gnu_debug const _Error_formatter& _M_sequence(const _Sequence& __seq, const char* __name = 0) const { - if (_M_num_parameters < __max_parameters) + if (_M_num_parameters < size_t(__max_parameters)) _M_parameters[_M_num_parameters++] = _Parameter(__seq, __name, _Is_sequence()); return *this; diff --git a/libstdc++-v3/include/ext/array_allocator.h b/libstdc++-v3/include/ext/array_allocator.h index 8689d9da26a..27169193306 100644 --- a/libstdc++-v3/include/ext/array_allocator.h +++ b/libstdc++-v3/include/ext/array_allocator.h @@ -121,9 +121,10 @@ namespace __gnu_cxx allocate(size_type __n, const void* = 0) { static size_type __array_used; - if (_M_array == 0 || __array_used + __n > _M_array->size()) + if (_M_array == 0 + || __array_used + __n > sizeof(*_M_array) / sizeof(_Tp)) std::__throw_bad_alloc(); - pointer __ret = _M_array->begin() + __array_used; + pointer __ret = reinterpret_cast<_Tp*>(_M_array) + __array_used; __array_used += __n; return __ret; } diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h index 9f02065046f..f607709e8f9 100644 --- a/libstdc++-v3/include/ext/bitmap_allocator.h +++ b/libstdc++-v3/include/ext/bitmap_allocator.h @@ -1,6 +1,6 @@ // Bitmap Allocator. -*- 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 @@ -717,10 +717,21 @@ namespace __gnu_cxx { return *__pui < __cui; } }; -#if defined __GTHREADS - static _Mutex _S_bfl_mutex; +#if defined __GTHREADS + _Mutex* + _M_get_mutex() + { + static _Mutex _S_mutex; + return &_S_mutex; + } #endif - static vector_type _S_free_list; + + vector_type& + _M_get_free_list() + { + static vector_type _S_free_list; + return _S_free_list; + } /** @brief Performs validation of memory based on their size. * @@ -735,12 +746,13 @@ namespace __gnu_cxx void _M_validate(size_t* __addr) throw() { + vector_type& __free_list = _M_get_free_list(); const vector_type::size_type __max_size = 64; - if (_S_free_list.size() >= __max_size) + if (__free_list.size() >= __max_size) { // Ok, the threshold value has been reached. We determine // which block to remove from the list of free blocks. - if (*__addr >= *_S_free_list.back()) + if (*__addr >= *__free_list.back()) { // Ok, the new block is greater than or equal to the // last block in the list of free blocks. We just free @@ -752,18 +764,18 @@ namespace __gnu_cxx { // Deallocate the last block in the list of free lists, // and insert the new one in it's correct position. - ::operator delete(static_cast<void*>(_S_free_list.back())); - _S_free_list.pop_back(); + ::operator delete(static_cast<void*>(__free_list.back())); + __free_list.pop_back(); } } // Just add the block to the list of free lists unconditionally. iterator __temp = __gnu_cxx::balloc::__lower_bound - (_S_free_list.begin(), _S_free_list.end(), + (__free_list.begin(), __free_list.end(), *__addr, _LT_pointer_compare()); // We may insert the new free list before _temp; - _S_free_list.insert(__temp, __addr); + __free_list.insert(__temp, __addr); } /** @brief Decides whether the wastage of memory is acceptable for @@ -801,7 +813,7 @@ namespace __gnu_cxx _M_insert(size_t* __addr) throw() { #if defined __GTHREADS - _Auto_Lock __bfl_lock(&_S_bfl_mutex); + _Auto_Lock __bfl_lock(_M_get_mutex()); #endif // Call _M_validate to decide what should be done with // this particular free list. diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h index de1656320a1..6177ded4daf 100644 --- a/libstdc++-v3/include/ext/mt_allocator.h +++ b/libstdc++-v3/include/ext/mt_allocator.h @@ -503,7 +503,7 @@ namespace __gnu_cxx static _Tune _S_tune(__align, sizeof(_Tp) * 64, sizeof(_Tp) * 2 >= __align ? sizeof(_Tp) * 2 : __align, - sizeof(_Tp) * _Tune::_S_chunk_size, + sizeof(_Tp) * size_t(_Tune::_S_chunk_size), _Tune::_S_max_threads, _Tune::_S_freelist_headroom, getenv("GLIBCXX_FORCE_NEW") ? true : false); @@ -549,7 +549,7 @@ namespace __gnu_cxx static _Tune _S_tune(__align, sizeof(_Tp) * 64, sizeof(_Tp) * 2 >= __align ? sizeof(_Tp) * 2 : __align, - sizeof(_Tp) * _Tune::_S_chunk_size, + sizeof(_Tp) * size_t(_Tune::_S_chunk_size), _Tune::_S_max_threads, _Tune::_S_freelist_headroom, getenv("GLIBCXX_FORCE_NEW") ? true : false); diff --git a/libstdc++-v3/include/ext/pod_char_traits.h b/libstdc++-v3/include/ext/pod_char_traits.h index c2f5551247d..a27b4cb2372 100644 --- a/libstdc++-v3/include/ext/pod_char_traits.h +++ b/libstdc++-v3/include/ext/pod_char_traits.h @@ -1,6 +1,6 @@ // POD character, std::char_traits specialization -*- C++ -*- -// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +// Copyright (C) 2002, 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 @@ -41,24 +41,47 @@ namespace __gnu_cxx { + // POD character abstraction. + // NB: The char_type parameter is a subset of int_type, as to allow + // int_type to properly hold the full range of char_type values as + // well as EOF. /// @brief A POD class that serves as a character abstraction class. template<typename V, typename I, typename S = mbstate_t> struct character { - typedef V value_type; - typedef I int_type; - typedef S state_type; + typedef V value_type; + typedef I int_type; + typedef S state_type; + typedef character<V, I, S> char_type; + value_type value; + + template<typename V2> + static char_type + from(const V2& v) + { + char_type ret = { static_cast<value_type>(v) }; + return ret; + } + + template<typename V2> + static V2 + to(const char_type& c) + { + V2 ret = { static_cast<V2>(c.value) }; + return ret; + } + }; - template<typename V, typename I> + template<typename V, typename I, typename S> inline bool - operator==(const character<V, I>& lhs, const character<V, I>& rhs) + operator==(const character<V, I, S>& lhs, const character<V, I, S>& rhs) { return lhs.value == rhs.value; } - template<typename V, typename I> + template<typename V, typename I, typename S> inline bool - operator<(const character<V, I>& lhs, const character<V, I>& rhs) + operator<(const character<V, I, S>& lhs, const character<V, I, S>& rhs) { return lhs.value < rhs.value; } } // namespace __gnu_cxx @@ -69,13 +92,6 @@ namespace std struct char_traits<__gnu_cxx::character<V, I, S> > { typedef __gnu_cxx::character<V, I, S> char_type; - - // NB: This type should be bigger than char_type, so as to - // properly hold EOF values in addition to the full range of - // char_type values. - // Also, assumes - // int_type(value_type) is valid. - // int_type(-1) is possible. typedef typename char_type::int_type int_type; typedef typename char_type::state_type state_type; typedef fpos<state_type> pos_type; @@ -122,41 +138,47 @@ namespace std static char_type* move(char_type* __s1, const char_type* __s2, size_t __n) - { return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); } + { + return static_cast<char_type*>(std::memmove(__s1, __s2, + __n * sizeof(char_type))); + } static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) - { return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); } + { + std::copy(__s2, __s2 + __n, __s1); + return __s1; + } static char_type* assign(char_type* __s, size_t __n, char_type __a) { - for (char_type* __p = __s; __p < __s + __n; ++__p) - assign(*__p, __a); + std::fill_n(__s, __n, __a); return __s; } static char_type - to_char_type(const int_type& __c) - { - char_type __r = { __c }; - return __r; - } + to_char_type(const int_type& __i) + { return char_type::template from(__i); } static int_type to_int_type(const char_type& __c) - { return int_type(__c.value); } + { return char_type::template to<int_type>(__c); } static bool eq_int_type(const int_type& __c1, const int_type& __c2) { return __c1 == __c2; } static int_type - eof() { return static_cast<int_type>(-1); } + eof() + { + int_type __r = { -1 }; + return __r; + } static int_type not_eof(const int_type& __c) - { return eq_int_type(__c, eof()) ? int_type(0) : __c; } + { return eq_int_type(__c, eof()) ? int_type() : __c; } }; } diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h index c5b2bec3dcb..afe2b32bf48 100644 --- a/libstdc++-v3/include/ext/pool_allocator.h +++ b/libstdc++-v3/include/ext/pool_allocator.h @@ -80,7 +80,7 @@ namespace __gnu_cxx enum { _S_align = 8 }; enum { _S_max_bytes = 128 }; - enum { _S_free_list_size = _S_max_bytes / _S_align }; + enum { _S_free_list_size = (size_t)_S_max_bytes / (size_t)_S_align }; union _Obj { diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope index 05ab668e67c..0f691e8ccdd 100644 --- a/libstdc++-v3/include/ext/rope +++ b/libstdc++-v3/include/ext/rope @@ -676,8 +676,8 @@ protected: return __size_with_eos; #else // Allow slop for in-place expansion. - return ((__size_with_eos + _S_alloc_granularity - 1) - &~ (_S_alloc_granularity - 1)); + return ((__size_with_eos + size_t(_S_alloc_granularity) - 1) + &~ (size_t(_S_alloc_granularity) - 1)); #endif } __GC_CONST _CharT* _M_data; /* Not necessarily 0 terminated. */ @@ -1998,7 +1998,7 @@ protected: size_type max_size() const { - return _S_min_len[_Rope_constants::_S_max_rope_depth - 1] - 1; + return _S_min_len[int(_Rope_constants::_S_max_rope_depth) - 1] - 1; // Guarantees that the result can be sufficirntly // balanced. Longer ropes will probably still work, // but it's harder to make guarantees. diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h index 51877699cb5..dad7ceef58e 100644 --- a/libstdc++-v3/include/ext/ropeimpl.h +++ b/libstdc++-v3/include/ext/ropeimpl.h @@ -116,7 +116,7 @@ namespace __gnu_cxx _Rope_iterator_base<_CharT, _Alloc>:: _S_setcache(_Rope_iterator_base<_CharT, _Alloc>& __x) { - const _RopeRep* __path[_Rope_constants::_S_max_rope_depth + 1]; + const _RopeRep* __path[int(_Rope_constants::_S_max_rope_depth) + 1]; const _RopeRep* __curr_rope; int __curr_depth = -1; /* index into path */ size_t __curr_start_pos = 0; @@ -175,7 +175,7 @@ namespace __gnu_cxx // Copy last section of path into _M_path_end. { int __i = -1; - int __j = __curr_depth + 1 - _S_path_cache_len; + int __j = __curr_depth + 1 - int(_S_path_cache_len); if (__j < 0) __j = 0; while (__j <= __curr_depth) @@ -236,10 +236,10 @@ namespace __gnu_cxx while (_Rope_constants::_S_concat == __current_node->_M_tag) { ++__current_index; - if (_S_path_cache_len == __current_index) + if (int(_S_path_cache_len) == __current_index) { int __i; - for (__i = 0; __i < _S_path_cache_len-1; __i++) + for (__i = 0; __i < int(_S_path_cache_len) - 1; __i++) __x._M_path_end[__i] = __x._M_path_end[__i+1]; --__current_index; } @@ -500,8 +500,9 @@ namespace __gnu_cxx get_allocator()); size_t __depth = __result->_M_depth; - if (__depth > 20 && (__result->_M_size < 1000 - || __depth > _Rope_constants::_S_max_rope_depth)) + if (__depth > 20 + && (__result->_M_size < 1000 + || __depth > size_t(_Rope_constants::_S_max_rope_depth))) { _RopeRep* __balanced; @@ -540,7 +541,7 @@ namespace __gnu_cxx return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->get_allocator()); if (_Rope_constants::_S_leaf == __r->_M_tag - && __r->_M_size + __slen <= _S_copy_max) + && __r->_M_size + __slen <= size_t(_S_copy_max)) { __result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen); return __result; @@ -551,7 +552,7 @@ namespace __gnu_cxx { _RopeLeaf* __right = (_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right); - if (__right->_M_size + __slen <= _S_copy_max) + if (__right->_M_size + __slen <= size_t(_S_copy_max)) { _RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left; _RopeRep* __nright = @@ -603,7 +604,7 @@ namespace __gnu_cxx __r->_M_ref_count = 2; // One more than before return __r; } - if (__orig_size + __slen <= _S_copy_max + if (__orig_size + __slen <= size_t(_S_copy_max) && _Rope_constants::_S_leaf == __r->_M_tag) { __result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, @@ -615,7 +616,7 @@ namespace __gnu_cxx _RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*) __r)->_M_right); if (_Rope_constants::_S_leaf == __right->_M_tag - && __right->_M_size + __slen <= _S_copy_max) + && __right->_M_size + __slen <= size_t(_S_copy_max)) { _RopeRep* __new_right = _S_destr_leaf_concat_char_iter(__right, __s, __slen); @@ -668,7 +669,7 @@ namespace __gnu_cxx { if (_Rope_constants::_S_leaf == __left->_M_tag) { - if (__right->_M_size + __left->_M_size <= _S_copy_max) + if (__right->_M_size + __left->_M_size <= size_t(_S_copy_max)) return _S_leaf_concat_char_iter((_RopeLeaf*)__left, ((_RopeLeaf*)__right)->_M_data, __right->_M_size); @@ -679,7 +680,8 @@ namespace __gnu_cxx { _RopeLeaf* __leftright = (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right); - if (__leftright->_M_size + __right->_M_size <= _S_copy_max) + if (__leftright->_M_size + + __right->_M_size <= size_t(_S_copy_max)) { _RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left; _RopeRep* __rest = _S_leaf_concat_char_iter(__leftright, @@ -1184,7 +1186,7 @@ namespace __gnu_cxx template <class _CharT, class _Alloc> const unsigned long rope<_CharT, _Alloc>:: - _S_min_len[_Rope_constants::_S_max_rope_depth + 1] = { + _S_min_len[int(_Rope_constants::_S_max_rope_depth) + 1] = { /* 0 */1, /* 1 */2, /* 2 */3, /* 3 */5, /* 4 */8, /* 5 */13, /* 6 */21, /* 7 */34, /* 8 */55, /* 9 */89, /* 10 */144, /* 11 */233, /* 12 */377, /* 13 */610, /* 14 */987, /* 15 */1597, /* 16 */2584, /* 17 */4181, @@ -1203,7 +1205,7 @@ namespace __gnu_cxx rope<_CharT, _Alloc>:: _S_balance(_RopeRep* __r) { - _RopeRep* __forest[_Rope_constants::_S_max_rope_depth + 1]; + _RopeRep* __forest[int(_Rope_constants::_S_max_rope_depth) + 1]; _RopeRep* __result = 0; int __i; // Invariant: @@ -1212,12 +1214,12 @@ namespace __gnu_cxx // __forest[__i]._M_depth = __i // References from forest are included in refcount. - for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i) + for (__i = 0; __i <= int(_Rope_constants::_S_max_rope_depth); ++__i) __forest[__i] = 0; try { _S_add_to_forest(__r, __forest); - for (__i = 0; __i <= _Rope_constants::_S_max_rope_depth; ++__i) + for (__i = 0; __i <= int(_Rope_constants::_S_max_rope_depth); ++__i) if (0 != __forest[__i]) { #ifndef __GC @@ -1232,12 +1234,12 @@ namespace __gnu_cxx } catch(...) { - for(__i = 0; __i <= _Rope_constants::_S_max_rope_depth; __i++) + for(__i = 0; __i <= int(_Rope_constants::_S_max_rope_depth); __i++) _S_unref(__forest[__i]); __throw_exception_again; } - if (__result->_M_depth > _Rope_constants::_S_max_rope_depth) + if (__result->_M_depth > int(_Rope_constants::_S_max_rope_depth)) __throw_length_error(__N("rope::_S_balance")); return(__result); } @@ -1305,7 +1307,7 @@ namespace __gnu_cxx __forest[__i]->_M_unref_nonnil(); __forest[__i] = 0; } - if (__i == _Rope_constants::_S_max_rope_depth + if (__i == int(_Rope_constants::_S_max_rope_depth) || __insertee->_M_size < _S_min_len[__i+1]) { __forest[__i] = __insertee; diff --git a/libstdc++-v3/include/std/std_bitset.h b/libstdc++-v3/include/std/std_bitset.h index dc677786a2d..76be09d821a 100644 --- a/libstdc++-v3/include/std/std_bitset.h +++ b/libstdc++-v3/include/std/std_bitset.h @@ -1,6 +1,6 @@ // <bitset> -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 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 @@ -751,7 +751,7 @@ namespace _GLIBCXX_STD */ template<class _CharT, class _Traits, class _Alloc> explicit - bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, + bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s, size_t __position = 0) : _Base() { @@ -759,7 +759,7 @@ namespace _GLIBCXX_STD __throw_out_of_range(__N("bitset::bitset initial position " "not valid")); _M_copy_from_string(__s, __position, - basic_string<_CharT, _Traits, _Alloc>::npos); + std::basic_string<_CharT, _Traits, _Alloc>::npos); } /** @@ -772,7 +772,7 @@ namespace _GLIBCXX_STD * which is neither '0' nor '1'. */ template<class _CharT, class _Traits, class _Alloc> - bitset(const basic_string<_CharT, _Traits, _Alloc>& __s, + bitset(const std::basic_string<_CharT, _Traits, _Alloc>& __s, size_t __position, size_t __n) : _Base() { @@ -1014,10 +1014,10 @@ namespace _GLIBCXX_STD * an example). */ template<class _CharT, class _Traits, class _Alloc> - basic_string<_CharT, _Traits, _Alloc> + std::basic_string<_CharT, _Traits, _Alloc> to_string() const { - basic_string<_CharT, _Traits, _Alloc> __result; + std::basic_string<_CharT, _Traits, _Alloc> __result; _M_copy_to_string(__result); return __result; } @@ -1025,28 +1025,36 @@ namespace _GLIBCXX_STD // _GLIBCXX_RESOLVE_LIB_DEFECTS // 434. bitset::to_string() hard to use. template<class _CharT, class _Traits> - basic_string<_CharT, _Traits, allocator<_CharT> > + std::basic_string<_CharT, _Traits, std::allocator<_CharT> > to_string() const - { return to_string<_CharT, _Traits, allocator<_CharT> >(); } + { return to_string<_CharT, _Traits, std::allocator<_CharT> >(); } template<class _CharT> - basic_string<_CharT, char_traits<_CharT>, allocator<_CharT> > + std::basic_string<_CharT, std::char_traits<_CharT>, + std::allocator<_CharT> > to_string() const - { return to_string<_CharT, char_traits<_CharT>, allocator<_CharT> >(); } + { + return to_string<_CharT, std::char_traits<_CharT>, + std::allocator<_CharT> >(); + } - basic_string<char, char_traits<char>, allocator<char> > + std::basic_string<char, std::char_traits<char>, std::allocator<char> > to_string() const - { return to_string<char, char_traits<char>, allocator<char> >(); } + { + return to_string<char, std::char_traits<char>, + std::allocator<char> >(); + } // Helper functions for string operations. template<class _CharT, class _Traits, class _Alloc> void - _M_copy_from_string(const basic_string<_CharT, _Traits, _Alloc>& __s, + _M_copy_from_string(const std::basic_string<_CharT, + _Traits, _Alloc>& __s, size_t, size_t); template<class _CharT, class _Traits, class _Alloc> void - _M_copy_to_string(basic_string<_CharT, _Traits, _Alloc>&) const; + _M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>&) const; /// Returns the number of bits which are set. size_t @@ -1136,7 +1144,7 @@ namespace _GLIBCXX_STD template<size_t _Nb> template<class _CharT, class _Traits, class _Alloc> void - bitset<_Nb>::_M_copy_from_string(const basic_string<_CharT, _Traits, + bitset<_Nb>::_M_copy_from_string(const std::basic_string<_CharT, _Traits, _Alloc>& __s, size_t __pos, size_t __n) { reset(); @@ -1159,7 +1167,7 @@ namespace _GLIBCXX_STD template<size_t _Nb> template<class _CharT, class _Traits, class _Alloc> void - bitset<_Nb>::_M_copy_to_string(basic_string<_CharT, _Traits, + bitset<_Nb>::_M_copy_to_string(std::basic_string<_CharT, _Traits, _Alloc>& __s) const { __s.assign(_Nb, '0'); @@ -1216,15 +1224,15 @@ namespace _GLIBCXX_STD * hold. */ template<class _CharT, class _Traits, size_t _Nb> - basic_istream<_CharT, _Traits>& - operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) + std::basic_istream<_CharT, _Traits>& + operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x) { typedef typename _Traits::char_type char_type; - basic_string<_CharT, _Traits> __tmp; + std::basic_string<_CharT, _Traits> __tmp; __tmp.reserve(_Nb); - ios_base::iostate __state = ios_base::goodbit; - typename basic_istream<_CharT, _Traits>::sentry __sentry(__is); + std::ios_base::iostate __state = std::ios_base::goodbit; + typename std::basic_istream<_CharT, _Traits>::sentry __sentry(__is); if (__sentry) { try @@ -1241,7 +1249,7 @@ namespace _GLIBCXX_STD typename _Traits::int_type __c1 = __buf->sbumpc(); if (_Traits::eq_int_type(__c1, __eof)) { - __state |= ios_base::eofbit; + __state |= std::ios_base::eofbit; break; } else @@ -1254,18 +1262,18 @@ namespace _GLIBCXX_STD else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof)) { - __state |= ios_base::failbit; + __state |= std::ios_base::failbit; break; } } } } catch(...) - { __is._M_setstate(ios_base::badbit); } + { __is._M_setstate(std::ios_base::badbit); } } if (__tmp.empty() && _Nb) - __state |= ios_base::failbit; + __state |= std::ios_base::failbit; else __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb); if (__state) @@ -1274,10 +1282,11 @@ namespace _GLIBCXX_STD } template <class _CharT, class _Traits, size_t _Nb> - basic_ostream<_CharT, _Traits>& - operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Nb>& __x) + std::basic_ostream<_CharT, _Traits>& + operator<<(std::basic_ostream<_CharT, _Traits>& __os, + const bitset<_Nb>& __x) { - basic_string<_CharT, _Traits> __tmp; + std::basic_string<_CharT, _Traits> __tmp; __x._M_copy_to_string(__tmp); return __os << __tmp; } diff --git a/libstdc++-v3/include/tr1/bind_iterate.h b/libstdc++-v3/include/tr1/bind_iterate.h new file mode 100644 index 00000000000..ed5aeb626e2 --- /dev/null +++ b/libstdc++-v3/include/tr1/bind_iterate.h @@ -0,0 +1,78 @@ +// TR1 functional -*- C++ -*- + +// Copyright (C) 2005 Free Software Foundation, Inc. +// Written by Douglas Gregor <doug.gregor -at- gmail.com> +// +// 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 2, or (at your option) +// 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. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 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 bind_iterate.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +#if _GLIBCXX_BIND_NUM_ARGS > 0 +template<_GLIBCXX_BIND_TEMPLATE_PARAMS> +#endif +#ifdef _GLIBCXX_BIND_HAS_RESULT_TYPE +result_type +#else +typename result_of<_Functor(_GLIBCXX_BIND_V_TEMPLATE_ARGS())>::type +#endif +operator()(_GLIBCXX_BIND_PARAMS) +{ return _M_f(_GLIBCXX_BIND_V_ARGS); } + +#if _GLIBCXX_BIND_NUM_ARGS > 0 +template<_GLIBCXX_BIND_TEMPLATE_PARAMS> +#endif +#ifdef _GLIBCXX_BIND_HAS_RESULT_TYPE +result_type +#else +typename result_of<const _Functor(_GLIBCXX_BIND_V_TEMPLATE_ARGS(const))>::type +#endif +operator()(_GLIBCXX_BIND_PARAMS) const +{ return _M_f(_GLIBCXX_BIND_V_ARGS); } + +#if _GLIBCXX_BIND_NUM_ARGS > 0 +template<_GLIBCXX_BIND_TEMPLATE_PARAMS> +#endif +#ifdef _GLIBCXX_BIND_HAS_RESULT_TYPE +result_type +#else +typename result_of<volatile _Functor(_GLIBCXX_BIND_V_TEMPLATE_ARGS(volatile))>::type +#endif +operator()(_GLIBCXX_BIND_PARAMS) volatile +{ return _M_f(_GLIBCXX_BIND_V_ARGS); } + +#if _GLIBCXX_BIND_NUM_ARGS > 0 +template<_GLIBCXX_BIND_TEMPLATE_PARAMS> +#endif +#ifdef _GLIBCXX_BIND_HAS_RESULT_TYPE +result_type +#else +typename result_of<const volatile _Functor(_GLIBCXX_BIND_V_TEMPLATE_ARGS(const volatile))>::type +#endif +operator()(_GLIBCXX_BIND_PARAMS) const volatile +{ return _M_f(_GLIBCXX_BIND_V_ARGS); } diff --git a/libstdc++-v3/include/tr1/bind_repeat.h b/libstdc++-v3/include/tr1/bind_repeat.h new file mode 100644 index 00000000000..2422a5b186f --- /dev/null +++ b/libstdc++-v3/include/tr1/bind_repeat.h @@ -0,0 +1,192 @@ +// TR1 code repetition for bind -*- C++ -*- + +// Copyright (C) 2005 Free Software Foundation, Inc. +// Written by Douglas Gregor <doug.gregor -at- gmail.com> +// +// 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 2, or (at your option) +// 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. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 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 bind_repeat.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +#ifndef _GLIBCXX_BIND_REPEAT_HEADER +# error Internal error: _GLIBCXX_BIND_REPEAT_HEADER must be set +#endif /* _GLIBCXX_BIND_REPEAT_HEADER */ + +#define _GLIBCXX_BIND_NUM_ARGS 0 +#define _GLIBCXX_BIND_COMMA +#define _GLIBCXX_BIND_TEMPLATE_PARAMS +#define _GLIBCXX_BIND_TEMPLATE_ARGS +#define _GLIBCXX_BIND_PARAMS +#define _GLIBCXX_BIND_ARGS +# include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 1 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1 +#define _GLIBCXX_BIND_PARAMS _U1& __u1 +#define _GLIBCXX_BIND_ARGS __u1 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS +#define _GLIBCXX_BIND_NUM_ARGS 2 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2 +#define _GLIBCXX_BIND_ARGS __u1, __u2 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 3 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 4 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 5 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4, typename _U5 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4, _U5 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4, _U5& __u5 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4, __u5 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 6 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4, _U5, _U6 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4, _U5& __u5, _U6& __u6 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4, __u5, __u6 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 7 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4, _U5, _U6, _U7 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4, _U5& __u5, _U6& __u6, _U7& __u7 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4, __u5, __u6, __u7 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 8 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7, typename _U8 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4, _U5& __u5, _U6& __u6, _U7& __u7, _U8& __u8 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4, __u5, __u6, __u7, __u8 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 9 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7, typename _U8, typename _U9 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4, _U5& __u5, _U6& __u6, _U7& __u7, _U8& __u8, _U9& __u9 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4, __u5, __u6, __u7, __u8, __u9 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + +#define _GLIBCXX_BIND_NUM_ARGS 10 +#define _GLIBCXX_BIND_COMMA , +#define _GLIBCXX_BIND_TEMPLATE_PARAMS typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7, typename _U8, typename _U9, typename _U10 +#define _GLIBCXX_BIND_TEMPLATE_ARGS _U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10 +#define _GLIBCXX_BIND_PARAMS _U1& __u1, _U2& __u2, _U3& __u3, _U4& __u4, _U5& __u5, _U6& __u6, _U7& __u7, _U8& __u8, _U9& __u9, _U10& __u10 +#define _GLIBCXX_BIND_ARGS __u1, __u2, __u3, __u4, __u5, __u6, __u7, __u8, __u9, __u10 +#include _GLIBCXX_BIND_REPEAT_HEADER +#undef _GLIBCXX_BIND_ARGS +#undef _GLIBCXX_BIND_PARAMS +#undef _GLIBCXX_BIND_TEMPLATE_ARGS +#undef _GLIBCXX_BIND_TEMPLATE_PARAMS +#undef _GLIBCXX_BIND_COMMA +#undef _GLIBCXX_BIND_NUM_ARGS + diff --git a/libstdc++-v3/include/tr1/boost_shared_ptr.h b/libstdc++-v3/include/tr1/boost_shared_ptr.h new file mode 100644 index 00000000000..3426a4acebe --- /dev/null +++ b/libstdc++-v3/include/tr1/boost_shared_ptr.h @@ -0,0 +1,981 @@ +// <tr1/boost_shared_ptr.h> -*- C++ -*- + +// Copyright (C) 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// 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. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 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. + +// shared_count.hpp +// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. + +// shared_ptr.hpp +// Copyright (C) 1998, 1999 Greg Colvin and Beman Dawes. +// Copyright (C) 2001, 2002, 2003 Peter Dimov + +// weak_ptr.hpp +// Copyright (C) 2001, 2002, 2003 Peter Dimov + +// enable_shared_from_this.hpp +// Copyright (C) 2002 Peter Dimov + +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// GCC Note: based on version 1.32.0 of the Boost library. + +/** @file boost_memory.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +#ifndef _BOOST_SHARED_PTR_H +#define _BOOST_SHARED_PTR_H 1 + +// namespace std::tr1 +namespace std +{ +namespace tr1 +{ + +class bad_weak_ptr : public std::exception +{ +public: + + virtual char const* what() const throw() + { + return "tr1::bad_weak_ptr"; + } +}; + +// Helper for exception objects in <tr1/memory> +// TODO this should be defined in a different file. +inline void +__throw_bad_weak_ptr() +{ +#if __EXCEPTIONS + throw bad_weak_ptr(); +#else + std::abort(); +#endif +} + + +template <typename _Tp> + struct _Sp_deleter + { + typedef void result_type; + typedef _Tp* argument_type; + + void + operator()(_Tp* p) const + { delete p; } + }; + + +class _Sp_counted_base +{ +public: + + _Sp_counted_base() + : _M_use_count(1), _M_weak_count(1) + { } + + virtual + ~_Sp_counted_base() // nothrow + { } + + // dispose() is called when _M_use_count drops to zero, to release + // the resources managed by *this. + virtual void + dispose() = 0; // nothrow + + // destroy() is called when _M_weak_count drops to zero. + virtual void + destroy() // nothrow + { + delete this; + } + + virtual void* + get_deleter(const std::type_info&) = 0; + + void + add_ref_copy() + { + __gnu_cxx::__atomic_add(&_M_use_count, 1); + } + + void + add_ref_lock() + { + __gnu_cxx::lock lock(_M_mutex); + if (__gnu_cxx::__exchange_and_add(&_M_use_count, 1) == 0) + { + _M_use_count = 0; + __throw_bad_weak_ptr(); + } + } + + void + release() // nothrow + { + if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) == 1) + { + dispose(); + __glibcxx_mutex_lock(_M_mutex); + __glibcxx_mutex_unlock(_M_mutex); + weak_release(); + } + } + + void + weak_add_ref() // nothrow + { + __gnu_cxx::__atomic_add(&_M_weak_count, 1); + } + + void + weak_release() // nothrow + { + if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) == 1) + { + __glibcxx_mutex_lock(_M_mutex); + __glibcxx_mutex_unlock(_M_mutex); + destroy(); + } + } + + long + use_count() const // nothrow + { + return _M_use_count; // XXX is this MT safe? + } + +private: + + _Sp_counted_base(_Sp_counted_base const&); + _Sp_counted_base& operator= (_Sp_counted_base const&); + + _Atomic_word _M_use_count; // #shared + _Atomic_word _M_weak_count; // #weak + (#shared != 0) + __gnu_cxx::mutex_type _M_mutex; +}; + +template <typename _Ptr, typename _Deleter> +class _Sp_counted_base_impl : public _Sp_counted_base +{ +public: + + /** + * @brief + * @pre d(p) must not throw. + */ + _Sp_counted_base_impl(_Ptr __p, _Deleter __d) + : _M_ptr(__p), _M_del(__d) + { } + + virtual void + dispose() // nothrow + { + _M_del(_M_ptr); + } + + virtual void* + get_deleter(const std::type_info& __ti) + { + return __ti == typeid(_Deleter) ? &_M_del : 0; + } + +private: + _Sp_counted_base_impl(const _Sp_counted_base_impl&); + _Sp_counted_base_impl& operator=(const _Sp_counted_base_impl&); + + _Ptr _M_ptr; // copy constructor must not throw + _Deleter _M_del; // copy constructor must not throw +}; + +class weak_count; + +class shared_count +{ +private: + + _Sp_counted_base* _M_pi; + + friend class weak_count; + +public: + + shared_count() + : _M_pi(0) // nothrow + { } + + template <typename _Ptr, typename _Deleter> + shared_count(_Ptr __p, _Deleter __d) + : _M_pi(0) + { + try + { + _M_pi = new _Sp_counted_base_impl<_Ptr, _Deleter>(__p, __d); + } + catch(...) + { + __d(__p); // delete __p + __throw_exception_again; + } + } + + // auto_ptr<_Tp> is special cased to provide the strong guarantee + + template <typename _Tp> + explicit shared_count(std::auto_ptr<_Tp>& __r) + : _M_pi(new _Sp_counted_base_impl<_Tp*,_Sp_deleter<_Tp> >( + __r.get(), _Sp_deleter<_Tp>() + )) + { __r.release(); } + + // throws bad_weak_ptr when __r.use_count() == 0 + explicit shared_count(const weak_count& __r); + + ~shared_count() // nothrow + { + if (_M_pi != 0) + _M_pi->release(); + } + + shared_count(const shared_count& __r) + : _M_pi(__r._M_pi) // nothrow + { + if (_M_pi != 0) + _M_pi->add_ref_copy(); + } + + shared_count& + operator=(const shared_count& __r) // nothrow + { + _Sp_counted_base* __tmp = __r._M_pi; + + if(__tmp != _M_pi) + { + if(__tmp != 0) + __tmp->add_ref_copy(); + if(_M_pi != 0) + _M_pi->release(); + _M_pi = __tmp; + } + return *this; + } + + void swap(shared_count& __r) // nothrow + { + _Sp_counted_base* __tmp = __r._M_pi; + __r._M_pi = _M_pi; + _M_pi = __tmp; + } + + long + use_count() const // nothrow + { return _M_pi != 0 ? _M_pi->use_count() : 0; } + + bool + unique() const // nothrow + { return this->use_count() == 1; } + + friend inline bool + operator==(const shared_count& __a, const shared_count& __b) + { return __a._M_pi == __b._M_pi; } + + friend inline bool + operator<(const shared_count& __a, const shared_count& __b) + { return std::less<_Sp_counted_base*>()(__a._M_pi, __b._M_pi); } + + void* + get_deleter(const std::type_info& __ti) const + { return _M_pi ? _M_pi->get_deleter(__ti) : 0; } +}; + + +class weak_count +{ +private: + + _Sp_counted_base * _M_pi; + + friend class shared_count; + +public: + + weak_count() + : _M_pi(0) // nothrow + { } + + weak_count(const shared_count& __r) + : _M_pi(__r._M_pi) // nothrow + { + if (_M_pi != 0) + _M_pi->weak_add_ref(); + } + + weak_count(const weak_count& __r) + : _M_pi(__r._M_pi) // nothrow + { + if (_M_pi != 0) + _M_pi->weak_add_ref(); + } + + ~weak_count() // nothrow + { + if (_M_pi != 0) + _M_pi->weak_release(); + } + + weak_count& + operator=(const shared_count& __r) // nothrow + { + _Sp_counted_base* __tmp = __r._M_pi; + if (__tmp != 0) + __tmp->weak_add_ref(); + if (_M_pi != 0) + _M_pi->weak_release(); + _M_pi = __tmp; + + return *this; + } + + weak_count& + operator=(const weak_count& __r) // nothrow + { + _Sp_counted_base * __tmp = __r._M_pi; + if (__tmp != 0) + __tmp->weak_add_ref(); + if (_M_pi != 0) + _M_pi->weak_release(); + _M_pi = __tmp; + + return *this; + } + + void + swap(weak_count& __r) // nothrow + { + _Sp_counted_base * __tmp = __r._M_pi; + __r._M_pi = _M_pi; + _M_pi = __tmp; + } + + long + use_count() const // nothrow + { return _M_pi != 0 ? _M_pi->use_count() : 0; } + + friend inline bool + operator==(const weak_count& __a, const weak_count& __b) + { return __a._M_pi == __b._M_pi; } + + friend inline bool + operator<(const weak_count& __a, const weak_count& __b) + { return std::less<_Sp_counted_base*>()(__a._M_pi, __b._M_pi); } +}; + +inline +shared_count::shared_count(const weak_count& __r) +: _M_pi(__r._M_pi) +{ + if (_M_pi != 0) + { + _M_pi->add_ref_lock(); + } + else + { + __throw_bad_weak_ptr(); + } +} + +// fwd decls +template <typename _Tp> class weak_ptr; +template <typename _Tp> class enable_shared_from_this; + +struct __static_cast_tag {}; +struct __const_cast_tag {}; +struct __dynamic_cast_tag {}; +struct __polymorphic_cast_tag {}; + +template<class _Tp> struct shared_ptr_traits +{ + typedef _Tp & reference; +}; + +template<> struct shared_ptr_traits<void> +{ + typedef void reference; +}; + +template<> struct shared_ptr_traits<void const> +{ + typedef void reference; +}; + +template<> struct shared_ptr_traits<void volatile> +{ + typedef void reference; +}; + +template<> struct shared_ptr_traits<void const volatile> +{ + typedef void reference; +}; + + +// enable_shared_from_this support + +// friend of enable_shared_from_this +template <typename _Tp1, typename _Tp2> + void + __enable_shared_from_this( const shared_count& __pn, + const enable_shared_from_this<_Tp1>* __pe, + const _Tp2* __px ); + +inline void +__enable_shared_from_this(const shared_count&, ...) +{ } + +/** + * @class shared_ptr <tr1/memory> + * + * A smart pointer with reference-counted copy semantics. + * The object pointed to is deleted when the last shared_ptr pointing to it + * is destroyed or reset. + */ + +template <typename _Tp> + class shared_ptr + { + typedef typename shared_ptr_traits<_Tp>::reference _Reference; + + public: + + typedef _Tp element_type; + + /** @brief Construct an empty %shared_ptr. + * @post use_count()==0 && get()==0 + */ + shared_ptr() : _M_ptr(0), _M_refcount() // never throws + { } + + /** @brief Construct a %shared_ptr that owns the pointer @a p. + * @param p A pointer that is convertible to element_type*. + * @post use_count()==1 && get()==p + * @throw std::bad_alloc, in which case @c delete @a p is called. + */ + template <typename _Tp1> + explicit shared_ptr(_Tp1* __p) + : _M_ptr(__p), _M_refcount(__p, _Sp_deleter<_Tp1>()) + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + // __glibcxx_function_requires(_CompleteConcept<_Tp1*>) + + __enable_shared_from_this( _M_refcount, __p, __p ); + } + + // + // Requirements: D's copy constructor and destructor must not throw + // + // shared_ptr will release p by calling d(p) + // + /** @brief Construct a %shared_ptr that owns the pointer @a p + * and the deleter @a d. + * @param p A pointer. + * @param d A deleter. + * @post use_count()==1 && get()==p + * @throw std::bad_alloc, in which case @a d(p) is called. + */ + template <typename _Tp1, typename _Deleter> + shared_ptr(_Tp1* __p, _Deleter __d) + : _M_ptr(__p), _M_refcount(__p, __d) + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + // TODO requires D is CopyConstructible and d(p) well-formed + + __enable_shared_from_this( _M_refcount, __p, __p ); + } + + // generated copy constructor, assignment, destructor are fine. + + /** @brief If @a r is empty, constructs an empty %shared_ptr; otherwise + * construct a %shared_ptr that shares ownership with @a r. + * @param r A %shared_ptr. + * @post get()==r.get() && use_count()==r.use_count() + * @throw std::bad_alloc, in which case + */ + template <typename _Tp1> + shared_ptr(const shared_ptr<_Tp1>& __r) + : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + } + + /** @brief Constructs a %shared_ptr that shares ownership with @a r + * and stores a copy of the pointer stored in @a r. + * @param r A weak_ptr. + * @post use_count()==r.use_count() + * @throw bad_weak_ptr when r.expired(), + * in which case the constructor has no effect. + */ + template <typename _Tp1> + explicit shared_ptr(const weak_ptr<_Tp1>& __r) + : _M_refcount(__r._M_refcount) // may throw + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + // it is now safe to copy r__._M_ptr, as _M_refcount(__r._M_refcount) + // did not throw + _M_ptr = __r._M_ptr; + } + + /** + * @post use_count()==1 and r.get()==0 + */ + template <typename _Tp1> + explicit shared_ptr(std::auto_ptr<_Tp1>& __r) + : _M_ptr(__r.get()), _M_refcount() + { + // TODO requires r.release() convertible to _Tp*, Tp1 is complete, + // delete r.release() well-formed + _Tp1 * __tmp = __r.get(); + _M_refcount = shared_count(__r); + + __enable_shared_from_this( _M_refcount, __tmp, __tmp ); + } + + template <typename _Tp1> + shared_ptr(const shared_ptr<_Tp1>& __r, __static_cast_tag) + : _M_ptr(static_cast<element_type*>(__r._M_ptr)) + , _M_refcount(__r._M_refcount) + { } + + template <typename _Tp1> + shared_ptr(const shared_ptr<_Tp1>& __r, __const_cast_tag) + : _M_ptr(const_cast<element_type*>(__r._M_ptr)) + , _M_refcount(__r._M_refcount) + { } + + template <typename _Tp1> + shared_ptr(const shared_ptr<_Tp1>& __r, __dynamic_cast_tag) + : _M_ptr(dynamic_cast<element_type*>(__r._M_ptr)) + , _M_refcount(__r._M_refcount) + { + if (_M_ptr == 0) // need to allocate new counter -- the cast failed + { + _M_refcount = shared_count(); + } + } + + template <typename _Tp1> + shared_ptr& + operator=(const shared_ptr<_Tp1>& __r) // never throws + { + _M_ptr = __r._M_ptr; + _M_refcount = __r._M_refcount; // shared_count::op= doesn't throw + return *this; + } + + template <typename _Tp1> + shared_ptr& + operator=(std::auto_ptr<_Tp1>& __r) + { + shared_ptr(__r).swap(*this); + return *this; + } + + void + reset() // never throws + { shared_ptr().swap(*this); } + + template <typename _Tp1> + void + reset(_Tp1* __p) // _Tp1 must be complete + { + _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr); // catch self-reset errors + shared_ptr(__p).swap(*this); + } + + template <typename _Tp1, typename _Deleter> + void + reset(_Tp1 * __p, _Deleter __d) + { shared_ptr(__p, __d).swap(*this); } + + // error to instantiate if _Tp is [cv-qual] void + _Reference + operator*() const // never throws + { + _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); + return *_M_ptr; + } + + _Tp* + operator->() const // never throws + { + _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); + return _M_ptr; + } + + _Tp* + get() const // never throws + { return _M_ptr; } + + // implicit conversion to "bool" + private: + typedef _Tp* shared_ptr::*__unspecified_bool_type; + + public: + operator __unspecified_bool_type() const // never throws + { return _M_ptr == 0 ? 0 : &shared_ptr::_M_ptr; } + + bool + unique() const // never throws + { return _M_refcount.unique(); } + + long + use_count() const // never throws + { return _M_refcount.use_count(); } + + void + swap(shared_ptr<_Tp>& __other) // never throws + { + std::swap(_M_ptr, __other._M_ptr); + _M_refcount.swap(__other._M_refcount); + } + + private: + template <typename _Tp1> + bool + _M_less(const shared_ptr<_Tp1>& __rhs) const + { return _M_refcount < __rhs._M_refcount; } + + void* + _M_get_deleter(const std::type_info& __ti) const + { return _M_refcount.get_deleter(__ti); } + + template <typename _Tp1> friend class shared_ptr; + template <typename _Tp1> friend class weak_ptr; + + // friends injected into enclosing namespace and found by ADL: + + // get_deleter (experimental) + template <typename _Del> + friend inline _Del* + get_deleter(const shared_ptr& __p) + { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); } + + template <typename _Tp1> + friend inline bool + operator==(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) + { return __a.get() == __b.get(); } + + template <typename _Tp1> + friend inline bool + operator!=(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) + { return __a.get() != __b.get(); } + + template <typename _Tp1> + friend inline bool + operator<(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) + { return __a._M_less(__b); } + + _Tp* _M_ptr; // contained pointer + shared_count _M_refcount; // reference counter + }; // shared_ptr + +// 2.2.3.9 shared_ptr casts + +/** @warning The seemingly equivalent + * <code>shared_ptr<T>(static_cast<T*>(r.get()))</code> + * will eventually result in undefined behaviour, + * attempting to delete the same object twice. + */ +template <typename _Tp, typename _Tp1> + shared_ptr<_Tp> + static_pointer_cast(const shared_ptr<_Tp1>& __r) + { + return shared_ptr<_Tp>(__r, __static_cast_tag()); + } + +/** @warning The seemingly equivalent + * <code>shared_ptr<T>(const_cast<T*>(r.get()))</code> + * will eventually result in undefined behaviour, + * attempting to delete the same object twice. + */ +template <typename _Tp, typename _Tp1> + shared_ptr<_Tp> + const_pointer_cast(const shared_ptr<_Tp1>& __r) + { + return shared_ptr<_Tp>(__r, __const_cast_tag()); + } + +/** @warning The seemingly equivalent + * <code>shared_ptr<T>(dynamic_cast<T*>(r.get()))</code> + * will eventually result in undefined behaviour, + * attempting to delete the same object twice. + */ +template <typename _Tp, typename _Tp1> + shared_ptr<_Tp> + dynamic_pointer_cast(const shared_ptr<_Tp1>& __r) + { + return shared_ptr<_Tp>(__r, __dynamic_cast_tag()); + } + +// operator<< +template <typename _Ch, typename _Tr, typename _Tp> + std::basic_ostream<_Ch,_Tr>& + operator<<(std::basic_ostream<_Ch,_Tr>& __os, const shared_ptr<_Tp>& __p) + { + __os << __p.get(); + return __os; + } + + +template <typename _Tp> + class weak_ptr + { + public: + + typedef _Tp element_type; + + weak_ptr() + : _M_ptr(0), _M_refcount() // never throws + { } + + // generated copy constructor, assignment, destructor are fine + + // + // The "obvious" converting constructor implementation: + // + // template<class Y> + // weak_ptr(weak_ptr<Y> const & r): _M_ptr(r._M_ptr), _M_refcount(r._M_refcount) // never throws + // { + // } + // + // has a serious problem. + // + // r._M_ptr may already have been invalidated. The _M_ptr(r._M_ptr) + // conversion may require access to *r._M_ptr (virtual inheritance). + // + // It is not possible to avoid spurious access violations since + // in multithreaded programs r._M_ptr may be invalidated at any point. + // + + template <typename _Tp1> + weak_ptr(const weak_ptr<_Tp1>& r) + : _M_refcount(r._M_refcount) // never throws + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + _M_ptr = r.lock().get(); + } + + template <typename _Tp1> + weak_ptr(const shared_ptr<_Tp1>& r) + : _M_ptr(r._M_ptr), _M_refcount(r._M_refcount) // never throws + { + __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) + } + + template <typename _Tp1> + weak_ptr& + operator=(const weak_ptr<_Tp1>& r) // never throws + { + _M_ptr = r.lock().get(); + _M_refcount = r._M_refcount; + return *this; + } + + template <typename _Tp1> + weak_ptr& + operator=(const shared_ptr<_Tp1>& r) // never throws + { + _M_ptr = r._M_ptr; + _M_refcount = r._M_refcount; + return *this; + } + + shared_ptr<_Tp> + lock() const // never throws + { +#ifdef __GTHREADS + + // optimization: avoid throw overhead + if (expired()) + { + return shared_ptr<element_type>(); + } + + try + { + return shared_ptr<element_type>(*this); + } + catch (const bad_weak_ptr&) + { + // Q: how can we get here? + // A: another thread may have invalidated r after the use_count test above. + return shared_ptr<element_type>(); + } + +#else + + // optimization: avoid try/catch overhead when single threaded + return expired() ? shared_ptr<element_type>() : shared_ptr<element_type>(*this); + +#endif + } // XXX MT + + + long + use_count() const // never throws + { return _M_refcount.use_count(); } + + bool + expired() const // never throws + { return _M_refcount.use_count() == 0; } + + void + reset() // never throws + { weak_ptr().swap(*this); } + + void + swap(weak_ptr& __s) // never throws + { + std::swap(_M_ptr, __s._M_ptr); + _M_refcount.swap(__s._M_refcount); + } + + private: + + template <typename _Tp1> + bool + _M_less(const weak_ptr<_Tp1>& __rhs) const + { return _M_refcount < __rhs._M_refcount; } + + // used by __enable_shared_from_this + void + _M_assign(_Tp* __ptr, const shared_count& __refcount) + { + _M_ptr = __ptr; + _M_refcount = __refcount; + } + + // friend injected into namespace and found by ADL + + template <typename _Tp1> + friend inline bool + operator<(const weak_ptr& __lhs, const weak_ptr<_Tp1>& __rhs) + { return __lhs._M_less(__rhs); } + + template <typename _Tp1> friend class weak_ptr; + template <typename _Tp1> friend class shared_ptr; + friend class enable_shared_from_this<_Tp>; + + _Tp* _M_ptr; // contained pointer + weak_count _M_refcount; // reference counter + + }; // weak_ptr + + + +template <typename _Tp> + class enable_shared_from_this + { + protected: + + enable_shared_from_this() + { } + + enable_shared_from_this(const enable_shared_from_this&) + { } + + enable_shared_from_this& + operator=(const enable_shared_from_this&) + { return *this; } + + ~enable_shared_from_this() + { } + + public: + + shared_ptr<_Tp> + shared_from_this() + { + shared_ptr<_Tp> p(this->_M_weak_this); + return p; + } + + shared_ptr<const _Tp> + shared_from_this() const + { + shared_ptr<const _Tp> p(this->_M_weak_this); + return p; + } + + private: + template <typename _Tp1> + void + _M_weak_assign(_Tp1* __p, const shared_count& __n) const + { _M_weak_this._M_assign(__p, __n); } + + template <typename _Tp1> + friend void + __enable_shared_from_this( const shared_count& __pn, const enable_shared_from_this* __pe, const _Tp1* __px) + { + if(__pe != 0) + __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn); + } + + mutable weak_ptr<_Tp> _M_weak_this; + }; + +} // namespace tr1 + +/** + * @brief std::swap() specialisation for shared_ptr. + * @relates shared_ptr. + */ +template <typename _Tp> + inline void + swap(tr1::shared_ptr<_Tp>& __a, tr1::shared_ptr<_Tp>& __b) + { + __a.swap(__b); + } + +/** + * @brief std::swap() specialisation for weak_ptr. + * @relates weak_ptr. + */ +template <typename _Tp> + void + swap(tr1::weak_ptr<_Tp>& __a, tr1::weak_ptr<_Tp>& __b) + { + __a.swap(__b); + } + +} // namespace std + +#endif diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index 778b9d7ef9a..abe92e3bf23 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -40,6 +40,7 @@ #include <bits/cpp_type_traits.h> #include <string> // for std::tr1::hash #include <cstdlib> // for std::abort +#include <tr1/tuple> namespace std { @@ -452,6 +453,17 @@ namespace tr1 == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))> { }; + template<typename _Signature> + struct result; + + template<typename _CVMem, typename _Tp> + struct result<_CVMem(_Tp)> + : public _Result_type<_Tp> { }; + + template<typename _CVMem, typename _Tp> + struct result<_CVMem(_Tp&)> + : public _Result_type<_Tp> { }; + explicit _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { } // Handle objects @@ -491,6 +503,229 @@ namespace tr1 } /** + * @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<typename _Tp> + 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<typename _Tp> + struct is_placeholder + { + static const int value = 0; + }; + + /** + * @if maint + * The type of placeholder objects defined by libstdc++. + * @endif + */ + template<int _Num> struct _Placeholder { }; + + /** + * @if maint + * Partial specialization of is_placeholder that provides the placeholder + * number for the placeholder objects defined by libstdc++. + * @endif + */ + template<int _Num> + 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<typename _Arg, + bool _IsBindExp = is_bind_expression<_Arg>::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<typename _Tp> + class _Mu<reference_wrapper<_Tp>, 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<typename _CVRef, typename _Tuple> + 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<typename _Arg> + class _Mu<_Arg, true, false> + { + public: + template<typename _Signature> class result; + +#define _GLIBCXX_REPEAT_HEADER <tr1/mu_iterate.h> +# include <tr1/repeat.h> +#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<typename _Arg> + class _Mu<_Arg, false, true> + { + public: + template<typename _Signature> class result; + + template<typename _CVMu, typename _CVArg, typename _Tuple> + 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 _Tuple> + 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<typename _Arg> + class _Mu<_Arg, false, false> + { + public: + template<typename _Signature> struct result; + + template<typename _CVMu, typename _CVArg, typename _Tuple> + struct result<_CVMu(_CVArg, _Tuple)> + { + typedef typename add_reference<_CVArg>::type type; + }; + + // Pick up the cv-qualifiers of the argument + template<typename _CVArg, typename _Tuple> + _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<typename _Tp> + 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<typename _Tp, typename _Class> + 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<typename _Signature> + struct _Bind; + + /** + * @if maint + * Type of the function object returned from bind<R>(). + * @endif + */ + template<typename _Result, typename _Signature> + struct _Bind_result; + + /** + * @if maint + * Class template _Bind is always a bind expression. + * @endif + */ + template<typename _Signature> + struct is_bind_expression<_Bind<_Signature> > + { + static const bool value = true; + }; + + /** + * @if maint + * Class template _Bind_result is always a bind expression. + * @endif + */ + template<typename _Result, typename _Signature> + 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. * @@ -845,9 +1080,15 @@ namespace tr1 __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 <tr1/functional_iterate.h> #include <tr1/repeat.h> #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<T> is defined is in clause 6.3.3. of the PDTR. diff --git a/libstdc++-v3/include/tr1/functional_iterate.h b/libstdc++-v3/include/tr1/functional_iterate.h index 97f4d248794..524f2d2be19 100644 --- a/libstdc++-v3/include/tr1/functional_iterate.h +++ b/libstdc++-v3/include/tr1/functional_iterate.h @@ -28,7 +28,7 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -/** @file function_iterate.h +/** @file functional_iterate.h * This is an internal header file, included by other library headers. * You should not attempt to use it directly. */ @@ -390,7 +390,89 @@ template<typename _Res, typename _Class _GLIBCXX_COMMA_SHIFTED }; #endif -template<typename _Signature, typename _Functor> class _Function_handler; +#if _GLIBCXX_NUM_ARGS > 0 +namespace placeholders +{ +namespace +{ + _Placeholder<_GLIBCXX_NUM_ARGS> _GLIBCXX_JOIN(_,_GLIBCXX_NUM_ARGS); +} +} +#endif + +template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> +class _Bind<_Functor(_GLIBCXX_TEMPLATE_ARGS)> + : public _Weak_result_type<_Functor> +{ + typedef _Bind __self_type; + + _Functor _M_f; + _GLIBCXX_BIND_MEMBERS + + public: +#if _GLIBCXX_NUM_ARGS == 0 + explicit +#endif + _Bind(_Functor __f _GLIBCXX_COMMA _GLIBCXX_PARAMS) + : _M_f(__f) _GLIBCXX_COMMA _GLIBCXX_BIND_MEMBERS_INIT { } + +#define _GLIBCXX_BIND_REPEAT_HEADER <tr1/bind_iterate.h> +#include <tr1/bind_repeat.h> +#undef _GLIBCXX_BIND_REPEAT_HEADER +}; + +template<typename _Result, typename _Functor + _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> +class _Bind_result<_Result, _Functor(_GLIBCXX_TEMPLATE_ARGS)> +{ + _Functor _M_f; + _GLIBCXX_BIND_MEMBERS + + public: + typedef _Result result_type; + +#if _GLIBCXX_NUM_ARGS == 0 + explicit +#endif + _Bind_result(_Functor __f _GLIBCXX_COMMA _GLIBCXX_PARAMS) + : _M_f(__f) _GLIBCXX_COMMA _GLIBCXX_BIND_MEMBERS_INIT { } + +#define _GLIBCXX_BIND_REPEAT_HEADER <tr1/bind_iterate.h> +#define _GLIBCXX_BIND_HAS_RESULT_TYPE +#include <tr1/bind_repeat.h> +#undef _GLIBCXX_BIND_HAS_RESULT_TYPE +#undef _GLIBCXX_BIND_REPEAT_HEADER +}; + +// Handle arbitrary function objects +template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> +inline +_Bind<typename _Maybe_wrap_member_pointer<_Functor>::type + (_GLIBCXX_TEMPLATE_ARGS)> +bind(_Functor __f _GLIBCXX_COMMA _GLIBCXX_PARAMS) +{ + typedef _Maybe_wrap_member_pointer<_Functor> __maybe_type; + typedef typename __maybe_type::type __functor_type; + typedef _Bind<__functor_type(_GLIBCXX_TEMPLATE_ARGS)> __result_type; + return __result_type(__maybe_type::__do_wrap(__f) + _GLIBCXX_COMMA _GLIBCXX_ARGS); +} + +template<typename _Result, typename _Functor + _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> +inline +_Bind_result<_Result, + typename _Maybe_wrap_member_pointer<_Functor>::type + (_GLIBCXX_TEMPLATE_ARGS)> +bind(_Functor __f _GLIBCXX_COMMA _GLIBCXX_PARAMS) +{ + typedef _Maybe_wrap_member_pointer<_Functor> __maybe_type; + typedef typename __maybe_type::type __functor_type; + typedef _Bind_result<_Result, __functor_type(_GLIBCXX_TEMPLATE_ARGS)> + __result_type; + return __result_type(__maybe_type::__do_wrap(__f) + _GLIBCXX_COMMA _GLIBCXX_ARGS); +} template<typename _Res, typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> diff --git a/libstdc++-v3/include/tr1/memory b/libstdc++-v3/include/tr1/memory index 64e2a900715..294d4868a47 100644 --- a/libstdc++-v3/include/tr1/memory +++ b/libstdc++-v3/include/tr1/memory @@ -27,19 +27,6 @@ // invalidate any other reasons why the executable file might be covered by // the GNU General Public License. -// boost/shared_count.hpp -// Copyright (c) 2001, 2002, 2003 Peter Dimov and Multi Media Ltd. - -// shared_ptr.hpp -// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. -// Copyright (c) 2001, 2002, 2003 Peter Dimov - -// weak_ptr.hpp -// Copyright (c) 2001, 2002, 2003 Peter Dimov - -// enable_shared_from_this.hpp -// Copyright (c) 2002 Peter Dimov - #ifndef _TR1_MEMORY #define _TR1_MEMORY 1 @@ -49,931 +36,16 @@ #include <new> // std::bad_alloc #include <typeinfo> // std::type_info in get_deleter #include <cstddef> // std::size_t -#include <algorithm> // for std::swap -#include <iosfwd> // for std::basic_ostream -#include <cstdlib> // for std::abort +#include <algorithm> // std::swap +#include <iosfwd> // std::basic_ostream +#include <cstdlib> // std::abort #include <bits/gthr.h> #include <bits/atomicity.h> #include <bits/functexcept.h> +#include <bits/concurrence.h> #include <debug/debug.h> -// namespace std::tr1 -namespace std -{ -namespace tr1 -{ - -class bad_weak_ptr : public std::exception -{ -public: - - virtual char const* what() const throw() - { - return "tr1::bad_weak_ptr"; - } -}; - -// Helper for exception objects in <tr1/memory> -// TODO this should be defined in a different file. -inline void -__throw_bad_weak_ptr() -{ -#if __EXCEPTIONS - throw bad_weak_ptr(); -#else - std::abort(); -#endif -} - - -template <typename _Tp> - struct _Sp_deleter - { - typedef void result_type; - typedef _Tp* argument_type; - - void - operator()(_Tp* p) const - { delete p; } - }; - - -class _Sp_counted_base -{ -public: - - _Sp_counted_base() - : _M_use_count(1), _M_weak_count(1) - { } - - virtual - ~_Sp_counted_base() // nothrow - { } - - // dispose() is called when _M_use_count drops to zero, to release - // the resources managed by *this. - virtual void - dispose() = 0; // nothrow - - // destroy() is called when _M_weak_count drops to zero. - virtual void - destroy() // nothrow - { - delete this; - } - - virtual void* - get_deleter(const std::type_info&) = 0; - - void - add_ref_copy() - { - __gnu_cxx::__atomic_add(&_M_use_count, 1); - } - - void - add_ref_lock() - { - if (_M_use_count <= 0) // TODO not yet MT safe XXX - { - __throw_bad_weak_ptr(); - } - __gnu_cxx::__atomic_add(&_M_use_count, 1); - } - - void - release() // nothrow - { - if (__gnu_cxx::__exchange_and_add(&_M_use_count, -1) <= 1) - { - dispose(); - weak_release(); - } - } - - void - weak_add_ref() // nothrow - { - __gnu_cxx::__atomic_add(&_M_weak_count, 1); - } - - void - weak_release() // nothrow - { - if (__gnu_cxx::__exchange_and_add(&_M_weak_count, -1) <= 1) - { - destroy(); - } - } - - long - use_count() const // nothrow - { - return _M_use_count; // XXX is this MT safe? - } - -private: - - _Sp_counted_base(_Sp_counted_base const&); - _Sp_counted_base& operator= (_Sp_counted_base const&); - - _Atomic_word _M_use_count; // #shared - _Atomic_word _M_weak_count; // #weak + (#shared != 0) -}; - -template <typename _Ptr, typename _Deleter> -class _Sp_counted_base_impl : public _Sp_counted_base -{ -public: - - /** - * @brief - * @pre d(p) must not throw. - */ - _Sp_counted_base_impl(_Ptr __p, _Deleter __d) - : _M_ptr(__p), _M_del(__d) - { } - - virtual void - dispose() // nothrow - { - _M_del(_M_ptr); - } - - virtual void* - get_deleter(const std::type_info& __ti) - { - return __ti == typeid(_Deleter) ? &_M_del : 0; - } - -private: - _Sp_counted_base_impl(const _Sp_counted_base_impl&); - _Sp_counted_base_impl& operator=(const _Sp_counted_base_impl&); - - _Ptr _M_ptr; // copy constructor must not throw - _Deleter _M_del; // copy constructor must not throw -}; - -class weak_count; - -class shared_count -{ -private: - - _Sp_counted_base* _M_pi; - - friend class weak_count; - -public: - - shared_count() - : _M_pi(0) // nothrow - { } - - template <typename _Ptr, typename _Deleter> - shared_count(_Ptr __p, _Deleter __d) - : _M_pi(0) - { - try - { - _M_pi = new _Sp_counted_base_impl<_Ptr, _Deleter>(__p, __d); - } - catch(...) - { - __d(__p); // delete __p - __throw_exception_again; - } - } - - // auto_ptr<_Tp> is special cased to provide the strong guarantee - - template <typename _Tp> - explicit shared_count(std::auto_ptr<_Tp>& __r) - : _M_pi(new _Sp_counted_base_impl<_Tp*,_Sp_deleter<_Tp> >( - __r.get(), _Sp_deleter<_Tp>() - )) - { __r.release(); } - - // throws bad_weak_ptr when __r.use_count() == 0 - explicit shared_count(const weak_count& __r); - - ~shared_count() // nothrow - { - if (_M_pi != 0) - _M_pi->release(); - } - - shared_count(const shared_count& __r) - : _M_pi(__r._M_pi) // nothrow - { - if (_M_pi != 0) - _M_pi->add_ref_copy(); - } - - shared_count& - operator=(const shared_count& __r) // nothrow - { - _Sp_counted_base* __tmp = __r._M_pi; - - if(__tmp != _M_pi) - { - if(__tmp != 0) - __tmp->add_ref_copy(); - if(_M_pi != 0) - _M_pi->release(); - _M_pi = __tmp; - } - return *this; - } - - void swap(shared_count& __r) // nothrow - { - _Sp_counted_base* __tmp = __r._M_pi; - __r._M_pi = _M_pi; - _M_pi = __tmp; - } - - long - use_count() const // nothrow - { return _M_pi != 0 ? _M_pi->use_count() : 0; } - - bool - unique() const // nothrow - { return this->use_count() == 1; } - - friend inline bool - operator==(const shared_count& __a, const shared_count& __b) - { return __a._M_pi == __b._M_pi; } - - friend inline bool - operator<(const shared_count& __a, const shared_count& __b) - { return std::less<_Sp_counted_base*>()(__a._M_pi, __b._M_pi); } - - void* - get_deleter(const std::type_info& __ti) const - { return _M_pi ? _M_pi->get_deleter(__ti) : 0; } -}; - - -class weak_count -{ -private: - - _Sp_counted_base * _M_pi; - - friend class shared_count; - -public: - - weak_count() - : _M_pi(0) // nothrow - { } - - weak_count(const shared_count& __r) - : _M_pi(__r._M_pi) // nothrow - { - if (_M_pi != 0) - _M_pi->weak_add_ref(); - } - - weak_count(const weak_count& __r) - : _M_pi(__r._M_pi) // nothrow - { - if (_M_pi != 0) - _M_pi->weak_add_ref(); - } - - ~weak_count() // nothrow - { - if (_M_pi != 0) - _M_pi->weak_release(); - } - - weak_count& - operator=(const shared_count& __r) // nothrow - { - _Sp_counted_base* __tmp = __r._M_pi; - if (__tmp != 0) - __tmp->weak_add_ref(); - if (_M_pi != 0) - _M_pi->weak_release(); - _M_pi = __tmp; - - return *this; - } - - weak_count& - operator=(const weak_count& __r) // nothrow - { - _Sp_counted_base * __tmp = __r._M_pi; - if (__tmp != 0) - __tmp->weak_add_ref(); - if (_M_pi != 0) - _M_pi->weak_release(); - _M_pi = __tmp; - - return *this; - } - - void - swap(weak_count& __r) // nothrow - { - _Sp_counted_base * __tmp = __r._M_pi; - __r._M_pi = _M_pi; - _M_pi = __tmp; - } - - long - use_count() const // nothrow - { return _M_pi != 0 ? _M_pi->use_count() : 0; } - - friend inline bool - operator==(const weak_count& __a, const weak_count& __b) - { return __a._M_pi == __b._M_pi; } - - friend inline bool - operator<(const weak_count& __a, const weak_count& __b) - { return std::less<_Sp_counted_base*>()(__a._M_pi, __b._M_pi); } -}; - -inline -shared_count::shared_count(const weak_count& __r) -: _M_pi(__r._M_pi) -{ - if (_M_pi != 0) - { - _M_pi->add_ref_lock(); - } - else - { - __throw_bad_weak_ptr(); - } -} - -// fwd decls -template <typename _Tp> class weak_ptr; -template <typename _Tp> class enable_shared_from_this; - -struct __static_cast_tag {}; -struct __const_cast_tag {}; -struct __dynamic_cast_tag {}; -struct __polymorphic_cast_tag {}; - -template<class _Tp> struct shared_ptr_traits -{ - typedef _Tp & reference; -}; - -template<> struct shared_ptr_traits<void> -{ - typedef void reference; -}; - -template<> struct shared_ptr_traits<void const> -{ - typedef void reference; -}; - -template<> struct shared_ptr_traits<void volatile> -{ - typedef void reference; -}; - -template<> struct shared_ptr_traits<void const volatile> -{ - typedef void reference; -}; - - -// enable_shared_from_this support - -// friend of enable_shared_from_this -template <typename _Tp1, typename _Tp2> - void - __enable_shared_from_this( const shared_count& __pn, - const enable_shared_from_this<_Tp1>* __pe, - const _Tp2* __px ); - -inline void -__enable_shared_from_this(const shared_count&, ...) -{ } - -/** - * @class shared_ptr <tr1/memory> - * - * A smart pointer with reference-counted copy semantics. - * The object pointed to is deleted when the last shared_ptr pointing to it - * is destroyed or reset. - */ - -template <typename _Tp> - class shared_ptr - { - typedef typename shared_ptr_traits<_Tp>::reference _Reference; - - public: - - typedef _Tp element_type; - - /** @brief Construct an empty %shared_ptr. - * @post use_count()==0 && get()==0 - */ - shared_ptr() : _M_ptr(0), _M_refcount() // never throws - { } - - /** @brief Construct a %shared_ptr that owns the pointer @a p. - * @param p A pointer that is convertible to element_type*. - * @post use_count()==1 && get()==p - * @throw std::bad_alloc, in which case @c delete @a p is called. - */ - template <typename _Tp1> - explicit shared_ptr(_Tp1* __p) - : _M_ptr(__p), _M_refcount(__p, _Sp_deleter<_Tp1>()) - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - // __glibcxx_function_requires(_CompleteConcept<_Tp1*>) - - __enable_shared_from_this( _M_refcount, __p, __p ); - } - - // - // Requirements: D's copy constructor and destructor must not throw - // - // shared_ptr will release p by calling d(p) - // - /** @brief Construct a %shared_ptr that owns the pointer @a p - * and the deleter @a d. - * @param p A pointer. - * @param d A deleter. - * @post use_count()==1 && get()==p - * @throw std::bad_alloc, in which case @a d(p) is called. - */ - template <typename _Tp1, typename _Deleter> - shared_ptr(_Tp1* __p, _Deleter __d) - : _M_ptr(__p), _M_refcount(__p, __d) - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - // TODO requires D is CopyConstructible and d(p) well-formed - - __enable_shared_from_this( _M_refcount, __p, __p ); - } - - // generated copy constructor, assignment, destructor are fine. - - /** @brief If @a r is empty, constructs an empty %shared_ptr; otherwise - * construct a %shared_ptr that shares ownership with @a r. - * @param r A %shared_ptr. - * @post get()==r.get() && use_count()==r.use_count() - * @throw std::bad_alloc, in which case - */ - template <typename _Tp1> - shared_ptr(const shared_ptr<_Tp1>& __r) - : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount) // never throws - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - } - - /** @brief Constructs a %shared_ptr that shares ownership with @a r - * and stores a copy of the pointer stored in @a r. - * @param r A weak_ptr. - * @post use_count()==r.use_count() - * @throw bad_weak_ptr when r.expired(), - * in which case the constructor has no effect. - */ - template <typename _Tp1> - explicit shared_ptr(const weak_ptr<_Tp1>& __r) - : _M_refcount(__r._M_refcount) // may throw - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - // it is now safe to copy r__._M_ptr, as _M_refcount(__r._M_refcount) - // did not throw - _M_ptr = __r._M_ptr; - } - - /** - * @post use_count()==1 and r.get()==0 - */ - template <typename _Tp1> - explicit shared_ptr(std::auto_ptr<_Tp1>& __r) - : _M_ptr(__r.get()), _M_refcount() - { - // TODO requires r.release() convertible to _Tp*, Tp1 is complete, - // delete r.release() well-formed - _Tp1 * __tmp = __r.get(); - _M_refcount = shared_count(__r); - - __enable_shared_from_this( _M_refcount, __tmp, __tmp ); - } - - template <typename _Tp1> - shared_ptr(const shared_ptr<_Tp1>& __r, __static_cast_tag) - : _M_ptr(static_cast<element_type*>(__r._M_ptr)) - , _M_refcount(__r._M_refcount) - { } - - template <typename _Tp1> - shared_ptr(const shared_ptr<_Tp1>& __r, __const_cast_tag) - : _M_ptr(const_cast<element_type*>(__r._M_ptr)) - , _M_refcount(__r._M_refcount) - { } - - template <typename _Tp1> - shared_ptr(const shared_ptr<_Tp1>& __r, __dynamic_cast_tag) - : _M_ptr(dynamic_cast<element_type*>(__r._M_ptr)) - , _M_refcount(__r._M_refcount) - { - if (_M_ptr == 0) // need to allocate new counter -- the cast failed - { - _M_refcount = shared_count(); - } - } - - template <typename _Tp1> - shared_ptr& - operator=(const shared_ptr<_Tp1>& __r) // never throws - { - _M_ptr = __r._M_ptr; - _M_refcount = __r._M_refcount; // shared_count::op= doesn't throw - return *this; - } - - template <typename _Tp1> - shared_ptr& - operator=(std::auto_ptr<_Tp1>& __r) - { - shared_ptr(__r).swap(*this); - return *this; - } - - void - reset() // never throws - { shared_ptr().swap(*this); } - - template <typename _Tp1> - void - reset(_Tp1* __p) // _Tp1 must be complete - { - _GLIBCXX_DEBUG_ASSERT(__p == 0 || __p != _M_ptr); // catch self-reset errors - shared_ptr(__p).swap(*this); - } - - template <typename _Tp1, typename _Deleter> - void - reset(_Tp1 * __p, _Deleter __d) - { shared_ptr(__p, __d).swap(*this); } - - // error to instantiate if _Tp is [cv-qual] void - _Reference - operator*() const // never throws - { - _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); - return *_M_ptr; - } - - _Tp* - operator->() const // never throws - { - _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0); - return _M_ptr; - } - - _Tp* - get() const // never throws - { return _M_ptr; } - - // implicit conversion to "bool" - private: - typedef _Tp* shared_ptr::*__unspecified_bool_type; - - public: - operator __unspecified_bool_type() const // never throws - { return _M_ptr == 0 ? 0 : &shared_ptr::_M_ptr; } - - bool - unique() const // never throws - { return _M_refcount.unique(); } - - long - use_count() const // never throws - { return _M_refcount.use_count(); } - - void - swap(shared_ptr<_Tp>& __other) // never throws - { - std::swap(_M_ptr, __other._M_ptr); - _M_refcount.swap(__other._M_refcount); - } - - private: - template <typename _Tp1> - bool - _M_less(const shared_ptr<_Tp1>& __rhs) const - { return _M_refcount < __rhs._M_refcount; } - - void* - _M_get_deleter(const std::type_info& __ti) const - { return _M_refcount.get_deleter(__ti); } - - template <typename _Tp1> friend class shared_ptr; - template <typename _Tp1> friend class weak_ptr; - - // friends injected into enclosing namespace and found by ADL: - - // get_deleter (experimental) - template <typename _Del> - friend inline _Del* - get_deleter(const shared_ptr& __p) - { return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del))); } - - template <typename _Tp1> - friend inline bool - operator==(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) - { return __a.get() == __b.get(); } - - template <typename _Tp1> - friend inline bool - operator!=(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) - { return __a.get() != __b.get(); } - - template <typename _Tp1> - friend inline bool - operator<(const shared_ptr& __a, const shared_ptr<_Tp1>& __b) - { return __a._M_less(__b); } - - _Tp* _M_ptr; // contained pointer - shared_count _M_refcount; // reference counter - }; // shared_ptr - -// 2.2.3.9 shared_ptr casts - -/** @warning The seemingly equivalent - * <code>shared_ptr<T>(static_cast<T*>(r.get()))</code> - * will eventually result in undefined behaviour, - * attempting to delete the same object twice. - */ -template <typename _Tp, typename _Tp1> - shared_ptr<_Tp> - static_pointer_cast(const shared_ptr<_Tp1>& __r) - { - return shared_ptr<_Tp>(__r, __static_cast_tag()); - } - -/** @warning The seemingly equivalent - * <code>shared_ptr<T>(const_cast<T*>(r.get()))</code> - * will eventually result in undefined behaviour, - * attempting to delete the same object twice. - */ -template <typename _Tp, typename _Tp1> - shared_ptr<_Tp> - const_pointer_cast(const shared_ptr<_Tp1>& __r) - { - return shared_ptr<_Tp>(__r, __const_cast_tag()); - } - -/** @warning The seemingly equivalent - * <code>shared_ptr<T>(dynamic_cast<T*>(r.get()))</code> - * will eventually result in undefined behaviour, - * attempting to delete the same object twice. - */ -template <typename _Tp, typename _Tp1> - shared_ptr<_Tp> - dynamic_pointer_cast(const shared_ptr<_Tp1>& __r) - { - return shared_ptr<_Tp>(__r, __dynamic_cast_tag()); - } - -// operator<< -template <typename _Ch, typename _Tr, typename _Tp> - std::basic_ostream<_Ch,_Tr>& - operator<<(std::basic_ostream<_Ch,_Tr>& __os, const shared_ptr<_Tp>& __p) - { - __os << __p.get(); - return __os; - } - - -template <typename _Tp> - class weak_ptr - { - public: - - typedef _Tp element_type; - - weak_ptr() - : _M_ptr(0), _M_refcount() // never throws - { } - - // generated copy constructor, assignment, destructor are fine - - // - // The "obvious" converting constructor implementation: - // - // template<class Y> - // weak_ptr(weak_ptr<Y> const & r): _M_ptr(r._M_ptr), _M_refcount(r._M_refcount) // never throws - // { - // } - // - // has a serious problem. - // - // r._M_ptr may already have been invalidated. The _M_ptr(r._M_ptr) - // conversion may require access to *r._M_ptr (virtual inheritance). - // - // It is not possible to avoid spurious access violations since - // in multithreaded programs r._M_ptr may be invalidated at any point. - // - - template <typename _Tp1> - weak_ptr(const weak_ptr<_Tp1>& r) - : _M_refcount(r._M_refcount) // never throws - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - _M_ptr = r.lock().get(); - } - - template <typename _Tp1> - weak_ptr(const shared_ptr<_Tp1>& r) - : _M_ptr(r._M_ptr), _M_refcount(r._M_refcount) // never throws - { - __glibcxx_function_requires(_ConvertibleConcept<_Tp1*, _Tp*>) - } - - template <typename _Tp1> - weak_ptr& - operator=(const weak_ptr<_Tp1>& r) // never throws - { - _M_ptr = r.lock().get(); - _M_refcount = r._M_refcount; - return *this; - } - - template <typename _Tp1> - weak_ptr& - operator=(const shared_ptr<_Tp1>& r) // never throws - { - _M_ptr = r._M_ptr; - _M_refcount = r._M_refcount; - return *this; - } - - shared_ptr<_Tp> - lock() const // never throws - { -#ifdef __GTHREADS - - // optimization: avoid throw overhead - if (expired()) - { - return shared_ptr<element_type>(); - } - - try - { - return shared_ptr<element_type>(*this); - } - catch (const bad_weak_ptr&) - { - // Q: how can we get here? - // A: another thread may have invalidated r after the use_count test above. - return shared_ptr<element_type>(); - } - -#else - - // optimization: avoid try/catch overhead when single threaded - return expired() ? shared_ptr<element_type>() : shared_ptr<element_type>(*this); - -#endif - } // XXX MT - - - long - use_count() const // never throws - { return _M_refcount.use_count(); } - - bool - expired() const // never throws - { return _M_refcount.use_count() == 0; } - - void - reset() // never throws - { weak_ptr().swap(*this); } - - void - swap(weak_ptr& __s) // never throws - { - std::swap(_M_ptr, __s._M_ptr); - _M_refcount.swap(__s._M_refcount); - } - - private: - - template <typename _Tp1> - bool - _M_less(const weak_ptr<_Tp1>& __rhs) const - { return _M_refcount < __rhs._M_refcount; } - - // used by __enable_shared_from_this - void - _M_assign(_Tp* __ptr, const shared_count& __refcount) - { - _M_ptr = __ptr; - _M_refcount = __refcount; - } - - // friend injected into namespace and found by ADL - - template <typename _Tp1> - friend inline bool - operator<(const weak_ptr& __lhs, const weak_ptr<_Tp1>& __rhs) - { return __lhs._M_less(__rhs); } - - template <typename _Tp1> friend class weak_ptr; - template <typename _Tp1> friend class shared_ptr; - friend class enable_shared_from_this<_Tp>; - - _Tp* _M_ptr; // contained pointer - weak_count _M_refcount; // reference counter - - }; // weak_ptr - - - -template <typename _Tp> - class enable_shared_from_this - { - protected: - - enable_shared_from_this() - { } - - enable_shared_from_this(const enable_shared_from_this&) - { } - - enable_shared_from_this& - operator=(const enable_shared_from_this&) - { return *this; } - - ~enable_shared_from_this() - { } - - public: - - shared_ptr<_Tp> - shared_from_this() - { - shared_ptr<_Tp> p(this->_M_weak_this); - return p; - } - - shared_ptr<const _Tp> - shared_from_this() const - { - shared_ptr<const _Tp> p(this->_M_weak_this); - return p; - } - - private: - template <typename _Tp1> - void - _M_weak_assign(_Tp1* __p, const shared_count& __n) const - { _M_weak_this._M_assign(__p, __n); } - - template <typename _Tp1> - friend void - __enable_shared_from_this( const shared_count& __pn, const enable_shared_from_this* __pe, const _Tp1* __px) - { - if(__pe != 0) - __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn); - } - - mutable weak_ptr<_Tp> _M_weak_this; - }; - -} // namespace tr1 - -/** - * @brief std::swap() specialisation for shared_ptr. - * @relates shared_ptr. - */ -template <typename _Tp> - inline void - swap(tr1::shared_ptr<_Tp>& __a, tr1::shared_ptr<_Tp>& __b) - { - __a.swap(__b); - } - -/** - * @brief std::swap() specialisation for weak_ptr. - * @relates weak_ptr. - */ -template <typename _Tp> - void - swap(tr1::weak_ptr<_Tp>& __a, tr1::weak_ptr<_Tp>& __b) - { - __a.swap(__b); - } - -} // namespace std +#include <tr1/boost_shared_ptr.h> #endif diff --git a/libstdc++-v3/include/tr1/mu_iterate.h b/libstdc++-v3/include/tr1/mu_iterate.h new file mode 100644 index 00000000000..57a81e3d7a9 --- /dev/null +++ b/libstdc++-v3/include/tr1/mu_iterate.h @@ -0,0 +1,51 @@ +// TR1 functional -*- C++ -*- + +// Copyright (C) 2005 Free Software Foundation, Inc. +// Written by Douglas Gregor <doug.gregor -at- gmail.com> +// +// 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 2, or (at your option) +// 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. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 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 mu_iterate.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +// Determine the result type when we pass the arguments along. This +// involves passing along the cv-qualifiers placed on _Mu and +// unwrapping the argument bundle. +template<typename _CVMu, typename _CVArg + _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> +class result<_CVMu(_CVArg, tuple<_GLIBCXX_TEMPLATE_ARGS>)> + : public result_of<_CVArg(_GLIBCXX_TEMPLATE_ARGS)> { }; + +template<typename _CVArg _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> +typename result_of<_CVArg(_GLIBCXX_TEMPLATE_ARGS)>::type +operator()(_CVArg& __arg, const tuple<_GLIBCXX_TEMPLATE_ARGS>& __tuple) + const volatile +{ + return __arg(_GLIBCXX_MU_GET_TUPLE_ARGS); +} + diff --git a/libstdc++-v3/include/tr1/ref_fwd.h b/libstdc++-v3/include/tr1/ref_fwd.h new file mode 100644 index 00000000000..10272a3889a --- /dev/null +++ b/libstdc++-v3/include/tr1/ref_fwd.h @@ -0,0 +1,59 @@ + + +// class template reference_wrapper forwarding header -*- C++ -*- + +// 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// 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. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 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 ref_fwd.h + * This is an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +// Douglas Gregor <doug.gregor -at- gmail.com> +#ifndef _TR1_REF_FWD +#define _TR1_REF_FWD + +namespace std +{ +namespace tr1 +{ + +template<typename _Tp> + class reference_wrapper; + +template<typename _Tp> + reference_wrapper<_Tp> + ref(_Tp& __t); + + // Denotes a const reference should be taken to a variable. +template<typename _Tp> + reference_wrapper<const _Tp> + cref(const _Tp& __t); +} +} +#endif diff --git a/libstdc++-v3/include/tr1/repeat.h b/libstdc++-v3/include/tr1/repeat.h index d87aeb9b14f..fa23c0b66b6 100644 --- a/libstdc++-v3/include/tr1/repeat.h +++ b/libstdc++-v3/include/tr1/repeat.h @@ -49,7 +49,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED #define _GLIBCXX_PARAMS_SHIFTED #define _GLIBCXX_ARGS_SHIFTED +#define _GLIBCXX_BIND_MEMBERS_INIT +#define _GLIBCXX_BIND_MEMBERS +#define _GLIBCXX_MU_GET_TUPLE_ARGS +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) +#define _GLIBCXX_BIND_V_ARGS +#define _GLIBCXX_TUPLE_ADD_CREF +#define _GLIBCXX_TUPLE_COPY_INIT +#define _GLIBCXX_TUPLE_ASSIGN +#define _GLIBCXX_TEMPLATE_PARAMS_U +#define _GLIBCXX_TEMPLATE_ARGS_U +#define _GLIBCXX_REF_WRAP_PARAMS +#define _GLIBCXX_REF_TEMPLATE_ARGS +#define _GLIBCXX_NUM_ARGS_PLUS_1 1 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T1 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -75,7 +103,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED #define _GLIBCXX_PARAMS_SHIFTED #define _GLIBCXX_ARGS_SHIFTED +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1& +#define _GLIBCXX_NUM_ARGS_PLUS_1 2 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T2 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -101,7 +157,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1 #define _GLIBCXX_ARGS_SHIFTED __a1 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2& +#define _GLIBCXX_NUM_ARGS_PLUS_1 3 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T3 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -127,7 +211,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3& +#define _GLIBCXX_NUM_ARGS_PLUS_1 4 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T4 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -153,7 +265,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4& +#define _GLIBCXX_NUM_ARGS_PLUS_1 5 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T5 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -179,7 +319,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; _T5 _M_arg5; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4), _M_arg5(__a5) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple), ::std::tr1::get<4>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T5> _CV(_T5, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T5>()(_M_arg5, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4, typename __add_c_ref<_T5>::type __a5 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4), _M_arg5(__in._M_arg5) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; _M_arg5 = __in._M_arg5; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4, typename _U5 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4, _U5 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5& +#define _GLIBCXX_NUM_ARGS_PLUS_1 6 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T6 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -205,7 +373,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; _T5 _M_arg5; _T6 _M_arg6; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4), _M_arg5(__a5), _M_arg6(__a6) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple), ::std::tr1::get<4>(__tuple), ::std::tr1::get<5>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T5> _CV(_T5, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T6> _CV(_T6, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T5>()(_M_arg5, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T6>()(_M_arg6, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4, typename __add_c_ref<_T5>::type __a5, typename __add_c_ref<_T6>::type __a6 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4), _M_arg5(__in._M_arg5), _M_arg6(__in._M_arg6) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; _M_arg5 = __in._M_arg5; _M_arg6 = __in._M_arg6; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4, _U5, _U6 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6& +#define _GLIBCXX_NUM_ARGS_PLUS_1 7 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T7 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -231,7 +427,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; _T5 _M_arg5; _T6 _M_arg6; _T7 _M_arg7; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4), _M_arg5(__a5), _M_arg6(__a6), _M_arg7(__a7) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple), ::std::tr1::get<4>(__tuple), ::std::tr1::get<5>(__tuple), ::std::tr1::get<6>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T5> _CV(_T5, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T6> _CV(_T6, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T7> _CV(_T7, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T5>()(_M_arg5, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T6>()(_M_arg6, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T7>()(_M_arg7, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4, typename __add_c_ref<_T5>::type __a5, typename __add_c_ref<_T6>::type __a6, typename __add_c_ref<_T7>::type __a7 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4), _M_arg5(__in._M_arg5), _M_arg6(__in._M_arg6), _M_arg7(__in._M_arg7) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; _M_arg5 = __in._M_arg5; _M_arg6 = __in._M_arg6; _M_arg7 = __in._M_arg7; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4, _U5, _U6, _U7 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7& +#define _GLIBCXX_NUM_ARGS_PLUS_1 8 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T8 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -257,7 +481,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; _T5 _M_arg5; _T6 _M_arg6; _T7 _M_arg7; _T8 _M_arg8; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4), _M_arg5(__a5), _M_arg6(__a6), _M_arg7(__a7), _M_arg8(__a8) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple), ::std::tr1::get<4>(__tuple), ::std::tr1::get<5>(__tuple), ::std::tr1::get<6>(__tuple), ::std::tr1::get<7>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T5> _CV(_T5, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T6> _CV(_T6, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T7> _CV(_T7, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T8> _CV(_T8, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T5>()(_M_arg5, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T6>()(_M_arg6, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T7>()(_M_arg7, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T8>()(_M_arg8, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4, typename __add_c_ref<_T5>::type __a5, typename __add_c_ref<_T6>::type __a6, typename __add_c_ref<_T7>::type __a7, typename __add_c_ref<_T8>::type __a8 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4), _M_arg5(__in._M_arg5), _M_arg6(__in._M_arg6), _M_arg7(__in._M_arg7), _M_arg8(__in._M_arg8) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; _M_arg5 = __in._M_arg5; _M_arg6 = __in._M_arg6; _M_arg7 = __in._M_arg7; _M_arg8 = __in._M_arg8; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7, typename _U8 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7), ref(__a8) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7&, _T8& +#define _GLIBCXX_NUM_ARGS_PLUS_1 9 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T9 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -283,7 +535,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; _T5 _M_arg5; _T6 _M_arg6; _T7 _M_arg7; _T8 _M_arg8; _T9 _M_arg9; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4), _M_arg5(__a5), _M_arg6(__a6), _M_arg7(__a7), _M_arg8(__a8), _M_arg9(__a9) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple), ::std::tr1::get<4>(__tuple), ::std::tr1::get<5>(__tuple), ::std::tr1::get<6>(__tuple), ::std::tr1::get<7>(__tuple), ::std::tr1::get<8>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T5> _CV(_T5, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T6> _CV(_T6, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T7> _CV(_T7, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T8> _CV(_T8, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T9> _CV(_T9, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T5>()(_M_arg5, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T6>()(_M_arg6, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T7>()(_M_arg7, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T8>()(_M_arg8, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T9>()(_M_arg9, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4, typename __add_c_ref<_T5>::type __a5, typename __add_c_ref<_T6>::type __a6, typename __add_c_ref<_T7>::type __a7, typename __add_c_ref<_T8>::type __a8, typename __add_c_ref<_T9>::type __a9 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4), _M_arg5(__in._M_arg5), _M_arg6(__in._M_arg6), _M_arg7(__in._M_arg7), _M_arg8(__in._M_arg8), _M_arg9(__in._M_arg9) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; _M_arg5 = __in._M_arg5; _M_arg6 = __in._M_arg6; _M_arg7 = __in._M_arg7; _M_arg8 = __in._M_arg8; _M_arg9 = __in._M_arg9; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7, typename _U8, typename _U9 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7), ref(__a8), ref(__a9) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7&, _T8&, _T9& +#define _GLIBCXX_NUM_ARGS_PLUS_1 10 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T10 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -297,6 +577,7 @@ #undef _GLIBCXX_COMMA #undef _GLIBCXX_NUM_ARGS +#define _GLIBCXX_LAST_INCLUDE #define _GLIBCXX_NUM_ARGS 10 #define _GLIBCXX_COMMA , #define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10 @@ -309,7 +590,35 @@ #define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9 #define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9 #define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9 +#define _GLIBCXX_BIND_MEMBERS _T1 _M_arg1; _T2 _M_arg2; _T3 _M_arg3; _T4 _M_arg4; _T5 _M_arg5; _T6 _M_arg6; _T7 _M_arg7; _T8 _M_arg8; _T9 _M_arg9; _T10 _M_arg10; +#define _GLIBCXX_BIND_MEMBERS_INIT _M_arg1(__a1), _M_arg2(__a2), _M_arg3(__a3), _M_arg4(__a4), _M_arg5(__a5), _M_arg6(__a6), _M_arg7(__a7), _M_arg8(__a8), _M_arg9(__a9), _M_arg10(__a10) +#define _GLIBCXX_MU_GET_TUPLE_ARGS ::std::tr1::get<0>(__tuple), ::std::tr1::get<1>(__tuple), ::std::tr1::get<2>(__tuple), ::std::tr1::get<3>(__tuple), ::std::tr1::get<4>(__tuple), ::std::tr1::get<5>(__tuple), ::std::tr1::get<6>(__tuple), ::std::tr1::get<7>(__tuple), ::std::tr1::get<8>(__tuple), ::std::tr1::get<9>(__tuple) +#define _GLIBCXX_BIND_V_TEMPLATE_ARGS(_CV) typename result_of<_Mu<_T1> _CV(_T1, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T2> _CV(_T2, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T3> _CV(_T3, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T4> _CV(_T4, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T5> _CV(_T5, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T6> _CV(_T6, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T7> _CV(_T7, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T8> _CV(_T8, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T9> _CV(_T9, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type, typename result_of<_Mu<_T10> _CV(_T10, tuple<_GLIBCXX_BIND_TEMPLATE_ARGS>)>::type +#define _GLIBCXX_BIND_V_ARGS _Mu<_T1>()(_M_arg1, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T2>()(_M_arg2, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T3>()(_M_arg3, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T4>()(_M_arg4, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T5>()(_M_arg5, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T6>()(_M_arg6, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T7>()(_M_arg7, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T8>()(_M_arg8, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T9>()(_M_arg9, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)), _Mu<_T10>()(_M_arg10, ::std::tr1::tie(_GLIBCXX_BIND_ARGS)) +#define _GLIBCXX_TUPLE_ADD_CREF typename __add_c_ref<_T1>::type __a1, typename __add_c_ref<_T2>::type __a2, typename __add_c_ref<_T3>::type __a3, typename __add_c_ref<_T4>::type __a4, typename __add_c_ref<_T5>::type __a5, typename __add_c_ref<_T6>::type __a6, typename __add_c_ref<_T7>::type __a7, typename __add_c_ref<_T8>::type __a8, typename __add_c_ref<_T9>::type __a9, typename __add_c_ref<_T10>::type __a10 +#define _GLIBCXX_TUPLE_COPY_INIT _M_arg1(__in._M_arg1), _M_arg2(__in._M_arg2), _M_arg3(__in._M_arg3), _M_arg4(__in._M_arg4), _M_arg5(__in._M_arg5), _M_arg6(__in._M_arg6), _M_arg7(__in._M_arg7), _M_arg8(__in._M_arg8), _M_arg9(__in._M_arg9), _M_arg10(__in._M_arg10) +#define _GLIBCXX_TUPLE_ASSIGN _M_arg1 = __in._M_arg1; _M_arg2 = __in._M_arg2; _M_arg3 = __in._M_arg3; _M_arg4 = __in._M_arg4; _M_arg5 = __in._M_arg5; _M_arg6 = __in._M_arg6; _M_arg7 = __in._M_arg7; _M_arg8 = __in._M_arg8; _M_arg9 = __in._M_arg9; _M_arg10 = __in._M_arg10; +#define _GLIBCXX_TEMPLATE_PARAMS_U typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, typename _U6, typename _U7, typename _U8, typename _U9, typename _U10 +#define _GLIBCXX_TEMPLATE_ARGS_U _U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10 +#define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7), ref(__a8), ref(__a9), ref(__a10) +#define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7&, _T8&, _T9&, _T10& +#define _GLIBCXX_NUM_ARGS_PLUS_1 11 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T11 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_NUM_ARGS_PLUS_1 +#undef _GLIBCXX_REF_TEMPLATE_ARGS +#undef _GLIBCXX_REF_WRAP_PARAMS +#undef _GLIBCXX_TEMPLATE_ARGS_U +#undef _GLIBCXX_TEMPLATE_PARAMS_U +#undef _GLIBCXX_TUPLE_ASSIGN +#undef _GLIBCXX_TUPLE_COPY_INIT +#undef _GLIBCXX_TUPLE_ADD_CREF +#undef _GLIBCXX_BIND_V_ARGS +#undef _GLIBCXX_BIND_V_TEMPLATE_ARGS +#undef _GLIBCXX_MU_GET_TUPLE_ARGS +#undef _GLIBCXX_BIND_MEMBERS_INIT +#undef _GLIBCXX_BIND_MEMBERS #undef _GLIBCXX_ARGS_SHIFTED #undef _GLIBCXX_PARAMS_SHIFTED #undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED @@ -323,263 +632,5 @@ #undef _GLIBCXX_COMMA #undef _GLIBCXX_NUM_ARGS -#define _GLIBCXX_NUM_ARGS 11 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 12 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 13 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 14 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 15 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14, _T15& __a15 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 16 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14, _T15& __a15, _T16& __a16 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 17 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14, _T15& __a15, _T16& __a16, _T17& __a17 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 18 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14, _T15& __a15, _T16& __a16, _T17& __a17, _T18& __a18 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 19 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18, typename _T19 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18, _T19 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18, _T19 __a19 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14, _T15& __a15, _T16& __a16, _T17& __a17, _T18& __a18, _T19& __a19 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18, __a19 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS - -#define _GLIBCXX_NUM_ARGS 20 -#define _GLIBCXX_COMMA , -#define _GLIBCXX_TEMPLATE_PARAMS typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18, typename _T19, typename _T20 -#define _GLIBCXX_TEMPLATE_ARGS _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18, _T19, _T20 -#define _GLIBCXX_PARAMS _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18, _T19 __a19, _T20 __a20 -#define _GLIBCXX_REF_PARAMS _T1& __a1, _T2& __a2, _T3& __a3, _T4& __a4, _T5& __a5, _T6& __a6, _T7& __a7, _T8& __a8, _T9& __a9, _T10& __a10, _T11& __a11, _T12& __a12, _T13& __a13, _T14& __a14, _T15& __a15, _T16& __a16, _T17& __a17, _T18& __a18, _T19& __a19, _T20& __a20 -#define _GLIBCXX_ARGS __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18, __a19, __a20 -#define _GLIBCXX_COMMA_SHIFTED , -#define _GLIBCXX_TEMPLATE_PARAMS_SHIFTED typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, typename _T11, typename _T12, typename _T13, typename _T14, typename _T15, typename _T16, typename _T17, typename _T18, typename _T19 -#define _GLIBCXX_TEMPLATE_ARGS_SHIFTED _T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10, _T11, _T12, _T13, _T14, _T15, _T16, _T17, _T18, _T19 -#define _GLIBCXX_PARAMS_SHIFTED _T1 __a1, _T2 __a2, _T3 __a3, _T4 __a4, _T5 __a5, _T6 __a6, _T7 __a7, _T8 __a8, _T9 __a9, _T10 __a10, _T11 __a11, _T12 __a12, _T13 __a13, _T14 __a14, _T15 __a15, _T16 __a16, _T17 __a17, _T18 __a18, _T19 __a19 -#define _GLIBCXX_ARGS_SHIFTED __a1, __a2, __a3, __a4, __a5, __a6, __a7, __a8, __a9, __a10, __a11, __a12, __a13, __a14, __a15, __a16, __a17, __a18, __a19 -#include _GLIBCXX_REPEAT_HEADER -#undef _GLIBCXX_ARGS_SHIFTED -#undef _GLIBCXX_PARAMS_SHIFTED -#undef _GLIBCXX_TEMPLATE_ARGS_SHIFTED -#undef _GLIBCXX_TEMPLATE_PARAMS_SHIFTED -#undef _GLIBCXX_COMMA_SHIFTED -#undef _GLIBCXX_ARGS -#undef _GLIBCXX_REF_PARAMS -#undef _GLIBCXX_PARAMS -#undef _GLIBCXX_TEMPLATE_ARGS -#undef _GLIBCXX_TEMPLATE_PARAMS -#undef _GLIBCXX_COMMA -#undef _GLIBCXX_NUM_ARGS +#undef _GLIBCXX_LAST_INCLUDE diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple index b3fed8ad6d6..89bccc3d495 100644 --- a/libstdc++-v3/include/tr1/tuple +++ b/libstdc++-v3/include/tr1/tuple @@ -27,1432 +27,249 @@ // 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. - */ +/** @file +* This is a TR1 C++ Library header. +*/ // Chris Jefferson <chris@bubblescope.net> -// This header is automatically generated: see maketuple.c for details. - #ifndef _TUPLE #define _TUPLE 1 #include <tr1/utility> -#include <tr1/functional> +#include <tr1/ref_fwd.h> 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<typename _Tp0 = _NullClass, typename _Tp1 = _NullClass, - typename _Tp2 = _NullClass, typename _Tp3 = _NullClass, - typename _Tp4 = _NullClass, typename _Tp5 = _NullClass, - typename _Tp6 = _NullClass, typename _Tp7 = _NullClass, - typename _Tp8 = _NullClass, typename _Tp9 = _NullClass> - class tuple; - - /// Gives the type of the ith element of a given tuple type. - template<int __i, typename _Tp> - struct tuple_element; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<0, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp0 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<1, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp1 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<2, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp2 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<3, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp3 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<4, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp4 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<5, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp5 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<6, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp6 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<7, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp7 type; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_element<8, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> > - { typedef _Tp8 type; }; - - /// @brief class tuple_element - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - 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<typename _Tp> - struct tuple_size; - - template<> - struct tuple_size<tuple<_NullClass, _NullClass, _NullClass, _NullClass, - _NullClass, _NullClass, _NullClass, _NullClass, - _NullClass, _NullClass> > - { static const int value = 0; }; - - template< typename _Tp0> - struct tuple_size<tuple< _Tp0, _NullClass, _NullClass, _NullClass, - _NullClass, _NullClass, _NullClass, _NullClass, - _NullClass, _NullClass> > - { static const int value = 1; }; - - template<typename _Tp0, typename _Tp1> - struct tuple_size<tuple<_Tp0, _Tp1, _NullClass, _NullClass, _NullClass, - _NullClass, _NullClass, _NullClass, _NullClass, - _NullClass> > - { static const int value = 2; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _NullClass, _NullClass, - _NullClass, _NullClass, _NullClass, _NullClass, - _NullClass> > - { static const int value = 3; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _NullClass, _NullClass, - _NullClass, _NullClass, _NullClass, _NullClass> > - { static const int value = 4; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _NullClass, - _NullClass, _NullClass, _NullClass, _NullClass> > - { static const int value = 5; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _NullClass, - _NullClass, _NullClass, _NullClass> > - { static const int value = 6; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _NullClass, _NullClass, _NullClass> > - { static const int value = 7; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, - _NullClass, _NullClass> > - { static const int value = 8; }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, - _Tp8, _NullClass> > - { static const int value = 9; }; - - /// @brief class tuple_size - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - struct tuple_size<tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, - _Tp8, _Tp9> > - { static const int value = 10; }; - - // Adds a const reference to a non-reference type. - template<typename _Tp> - struct __add_c_ref - { typedef const _Tp& type; }; - - template<typename _Tp> - struct __add_c_ref<_Tp&> - { typedef _Tp& type; }; - - // Adds a reference to a non-reference type. - template<typename _Tp> - struct __add_ref - { typedef _Tp& type; }; - - template<typename _Tp> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1> - 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<typename _Up0, typename _Up1> - tuple(const tuple<_Up0, _Up1>& __in): - _M_t0(__in._M_t0), _M_t1(__in._M_t1) - { } - - template<class _Up1, class _Up2> - 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<typename _Up0, typename _Up1> - tuple& - operator=(const tuple<_Up0, _Up1>& __in) - { - _M_t0=__in._M_t0; - _M_t1=__in._M_t1; - return *this; - } - - template<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2> - 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<typename _Up0, typename _Up1, typename _Up2> - 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<typename _Up0, typename _Up1, typename _Up2> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6, typename _Up7> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6, typename _Up7> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6, typename _Up7, - typename _Up8> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6, typename _Up7, - typename _Up8> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - /// @brief Template class tuple - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6, typename _Up7, - typename _Up8, typename _Up9> - 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<typename _Up0, typename _Up1, typename _Up2, typename _Up3, - typename _Up4, typename _Up5, typename _Up6, typename _Up7, - typename _Up8, typename _Up9> - 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<int __i, typename _Up> - friend class __get_helper; - template<typename, typename, typename, typename, typename, typename, - typename, typename, typename, typename> - friend class tuple; - }; - - // Class used in the implementation of get - template<int __i, typename _Tp> - struct __get_helper; - - template<typename _Tp> - struct __get_helper<0, _Tp> - { - static typename __add_ref<typename tuple_element<0, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t0; } - - static typename __add_c_ref<typename tuple_element<0, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t0; } - }; - - template<typename _Tp> - struct __get_helper<1, _Tp> - { - static typename __add_ref<typename tuple_element<1, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t1; } - - static typename __add_c_ref<typename tuple_element<1, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t1; } - }; - - template<typename _Tp> - struct __get_helper<2, _Tp> - { - static typename __add_ref<typename tuple_element<2, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t2; } - - static typename __add_c_ref<typename tuple_element<2, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t2; } - }; - - template<typename _Tp> - struct __get_helper<3, _Tp> - { - static typename __add_ref<typename tuple_element<3, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t3; } - - static typename __add_c_ref<typename tuple_element<3, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t3; } - }; - - template<typename _Tp> - struct __get_helper<4, _Tp> - { - static typename __add_ref<typename tuple_element<4, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t4; } - - static typename __add_c_ref<typename tuple_element<4, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t4; } - }; - - template<typename _Tp> - struct __get_helper<5, _Tp> - { - static typename __add_ref<typename tuple_element<5, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t5; } - - static typename __add_c_ref<typename tuple_element<5, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t5; } - }; - - template<typename _Tp> - struct __get_helper<6, _Tp> - { - static typename __add_ref<typename tuple_element<6, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t6; } - - static typename __add_c_ref<typename tuple_element<6, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t6; } - }; - - template<typename _Tp> - struct __get_helper<7, _Tp> - { - static typename __add_ref<typename tuple_element<7, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t7; } - - static typename __add_c_ref<typename tuple_element<7, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t7; } - }; - - template<typename _Tp> - struct __get_helper<8, _Tp> - { - static typename __add_ref<typename tuple_element<8, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t8; } - - static typename __add_c_ref<typename tuple_element<8, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t8; } - }; - - template<typename _Tp> - struct __get_helper<9, _Tp> - { - static typename __add_ref<typename tuple_element<9, _Tp>::type>::type - get_value(_Tp& __in) - { return __in._M_t9; } - - static typename __add_c_ref<typename tuple_element<9, _Tp>::type>::type - get_value(const _Tp& __in) - { return __in._M_t9; } - }; - - // Returns a reference to the ith element of a tuple. - // Any const or non-const ref elements are returned with their original type. - template<int __i, typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - typename __add_ref<typename tuple_element<__i, tuple<_Tp0, _Tp1, _Tp2, - _Tp3, _Tp4, _Tp5, - _Tp6, _Tp7, _Tp8, - _Tp9> >::type>::type - get(tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, - _Tp9>& __t) - { - return __get_helper<__i, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> >::get_value(__t); - } - - // Returns a const reference to the ith element of a tuple. - // Any const or non-const ref elements are returned with their original type. - template<int __i, typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - typename __add_c_ref<typename tuple_element<__i, tuple<_Tp0, _Tp1, _Tp2, - _Tp3, _Tp4, _Tp5, - _Tp6, _Tp7, _Tp8, - _Tp9> >::type>::type - get(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, - _Tp9>& __t) - { - return __get_helper<__i, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9> >::get_value(__t); - } - - // This class helps construct the various comparison operations on tuples - template<int __check_equal_size, int __i, int __j, typename _Tp, typename _Up> - struct __tuple_compare; - - template<int __i, int __j, typename _Tp, typename _Up> - struct __tuple_compare<0, __i, __j, _Tp, _Up> - { - static bool __eq(const _Tp& __t, const _Up& __u) - { - return get<__i>(__t) == get<__i>(__u) && - __tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u); - } - static bool __less(const _Tp& __t, const _Up& __u) - { - return (get<__i>(__t) < get<__i>(__u)) || !(get<__i>(__u) < get<__i>(__t)) && - __tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u); - } - }; - - template<int __i, typename _Tp, typename _Up> - struct __tuple_compare<0, __i, __i, _Tp, _Up> - { - static bool __eq(const _Tp&, const _Up&) - { return true; } - static bool __less(const _Tp&, const _Up&) - { return false; } - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9, typename _Up0, typename _Up1, - typename _Up2, typename _Up3, typename _Up4, typename _Up5, - typename _Up6, typename _Up7, typename _Up8, typename _Up9> - bool - operator==(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>& __t, - const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, _Up9>& __u) - { - typedef tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, - _Tp9> _Tp; - typedef tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, - _Up9> _Up; - return __tuple_compare<tuple_size<_Tp>::value - - tuple_size<_Tp>::value, 0, - tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9, typename _Up0, typename _Up1, - typename _Up2, typename _Up3, typename _Up4, typename _Up5, - typename _Up6, typename _Up7, typename _Up8, typename _Up9> - bool - operator<(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>& __t, - const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, _Up9>& __u) - { - typedef tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, - _Tp9> _Tp; - typedef tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, - _Up9> _Up; - return __tuple_compare<tuple_size<_Tp>::value - - tuple_size<_Tp>::value, 0, - tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9, typename _Up0, typename _Up1, - typename _Up2, typename _Up3, typename _Up4, typename _Up5, - typename _Up6, typename _Up7, typename _Up8, typename _Up9> - bool - operator!=(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>& __t, - const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, _Up9>& __u) - { - return !(__t == __u); - } - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9, typename _Up0, typename _Up1, - typename _Up2, typename _Up3, typename _Up4, typename _Up5, - typename _Up6, typename _Up7, typename _Up8, typename _Up9> - bool - operator>(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>& __t, - const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, _Up9>& __u) - { - return __u < __t; - } - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9, typename _Up0, typename _Up1, - typename _Up2, typename _Up3, typename _Up4, typename _Up5, - typename _Up6, typename _Up7, typename _Up8, typename _Up9> - bool - operator<=(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>& __t, - const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, _Up9>& __u) - { - return !(__u < __t); - } - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9, typename _Up0, typename _Up1, - typename _Up2, typename _Up3, typename _Up4, typename _Up5, - typename _Up6, typename _Up7, typename _Up8, typename _Up9> - bool - operator>=(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>& __t, - const tuple<_Up0, _Up1, _Up2, _Up3, _Up4, _Up5, _Up6, _Up7, _Up8, _Up9>& __u) - { - return !(__t < __u); - } - - // Helper which adds a reference to a type when given a reference_wrapper - template<typename _Tp> - struct __strip_reference_wrapper - { - typedef _Tp __type; - }; - - template<typename _Tp> - struct __strip_reference_wrapper<reference_wrapper<_Tp> > - { - typedef _Tp& __type; - }; - - template<typename _Tp> - struct __strip_reference_wrapper<const reference_wrapper<_Tp> > - { - typedef _Tp& __type; - }; - - template<typename _Tp0 = _NullClass, typename _Tp1 = _NullClass, - typename _Tp2 = _NullClass, typename _Tp3 = _NullClass, - typename _Tp4 = _NullClass, typename _Tp5 = _NullClass, - typename _Tp6 = _NullClass, typename _Tp7 = _NullClass, - typename _Tp8 = _NullClass, typename _Tp9 = _NullClass> - struct __stripped_tuple_type - { - typedef tuple<typename __strip_reference_wrapper<_Tp0>::__type, - typename __strip_reference_wrapper<_Tp1>::__type, - typename __strip_reference_wrapper<_Tp2>::__type, - typename __strip_reference_wrapper<_Tp3>::__type, - typename __strip_reference_wrapper<_Tp4>::__type, - typename __strip_reference_wrapper<_Tp5>::__type, - typename __strip_reference_wrapper<_Tp6>::__type, - typename __strip_reference_wrapper<_Tp7>::__type, - typename __strip_reference_wrapper<_Tp8>::__type, - typename __strip_reference_wrapper<_Tp9>::__type> __type; - }; - - tuple<> - make_tuple() - { return tuple<>(); } - - template< typename _Tp0> - typename __stripped_tuple_type< _Tp0>::__type - make_tuple( _Tp0 __t0) - { - return typename __stripped_tuple_type< _Tp0>:: - __type( __t0); - } - - template<typename _Tp0, typename _Tp1> - typename __stripped_tuple_type<_Tp0, _Tp1>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1) - { - return typename __stripped_tuple_type<_Tp0, _Tp1>:: - __type(__t0, __t1); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2>:: - __type(__t0, __t1, __t2); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3>:: - __type(__t0, __t1, __t2, __t3); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3, _Tp4 __t4) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4>:: - __type(__t0, __t1, __t2, __t3, __t4); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, - _Tp5>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3, _Tp4 __t4, - _Tp5 __t5) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, - _Tp5>:: - __type(__t0, __t1, __t2, __t3, __t4, __t5); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, - _Tp6>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3, _Tp4 __t4, - _Tp5 __t5, _Tp6 __t6) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, - _Tp5, _Tp6>:: - __type(__t0, __t1, __t2, __t3, __t4, __t5, __t6); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3, _Tp4 __t4, - _Tp5 __t5, _Tp6 __t6, _Tp7 __t7) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, - _Tp5, _Tp6, _Tp7>:: - __type(__t0, __t1, __t2, __t3, __t4, __t5, __t6, __t7); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3, _Tp4 __t4, - _Tp5 __t5, _Tp6 __t6, _Tp7 __t7, _Tp8 __t8) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, - _Tp5, _Tp6, _Tp7, _Tp8>:: - __type(__t0, __t1, __t2, __t3, __t4, __t5, __t6, __t7, __t8); - } - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, - _Tp7, _Tp8, _Tp9>::__type - make_tuple(_Tp0 __t0, _Tp1 __t1, _Tp2 __t2, _Tp3 __t3, _Tp4 __t4, - _Tp5 __t5, _Tp6 __t6, _Tp7 __t7, _Tp8 __t8, _Tp9 __t9) - { - return typename __stripped_tuple_type<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, - _Tp5, _Tp6, _Tp7, _Tp8, _Tp9>:: - __type(__t0, __t1, __t2, __t3, __t4, __t5, __t6, __t7, __t8, __t9); - } - - // A class (and instance) which can be used in 'tie' when an element - // of a tuple is not required - struct swallow_assign - { - template<class T> - swallow_assign& - operator=(const T&) - { return *this; } - }; - - // TODO: Put this in some kind of shared file. - namespace - { - swallow_assign ignore; - }; - - - // Forms a tuple of references to a list of variables. - template< typename _Tp0> - tuple< _Tp0&> - tie( _Tp0& __t0) - { - return make_tuple( ref(__t0)); - }; - - template<typename _Tp0, typename _Tp1> - tuple<_Tp0&, _Tp1&> - tie(_Tp0& __t0, _Tp1& __t1) - { - return make_tuple(ref(__t0), ref(__t1)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2> - tuple<_Tp0&, _Tp1&, _Tp2&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&, _Tp4&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3, _Tp4& __t4) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3), - ref(__t4)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&, _Tp4&, _Tp5&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3, _Tp4& __t4, - _Tp5& __t5) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3), ref(__t4), - ref(__t5)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&, _Tp4&, _Tp5&, _Tp6&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3, _Tp4& __t4, _Tp5& __t5, - _Tp6& __t6) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3), ref(__t4), - ref(__t5), ref(__t6)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&, _Tp4&, _Tp5&, _Tp6&, _Tp7&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3, _Tp4& __t4, _Tp5& __t5, - _Tp6& __t6, _Tp7& __t7) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3), ref(__t4), - ref(__t5), ref(__t6), ref(__t7)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&, _Tp4&, _Tp5&, _Tp6&, _Tp7&, _Tp8&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3, _Tp4& __t4, _Tp5& __t5, - _Tp6& __t6, _Tp7& __t7, _Tp8& __t8) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3), ref(__t4), - ref(__t5), ref(__t6), ref(__t7), ref(__t8)); - }; - - template<typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, - typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, - typename _Tp8, typename _Tp9> - tuple<_Tp0&, _Tp1&, _Tp2&, _Tp3&, _Tp4&, _Tp5&, _Tp6&, _Tp7&, _Tp8&, - _Tp9&> - tie(_Tp0& __t0, _Tp1& __t1, _Tp2& __t2, _Tp3& __t3, _Tp4& __t4, _Tp5& __t5, - _Tp6& __t6, _Tp7& __t7, _Tp8& __t8, _Tp9& __t9) - { - return make_tuple(ref(__t0), ref(__t1), ref(__t2), ref(__t3), ref(__t4), - ref(__t5), ref(__t6), ref(__t7), ref(__t8), - ref(__t9)); - }; - + // An implementation specific class which is used in the tuple class + // when the tuple is not maximum possible size. + struct _NullClass { }; + + template<typename _Tp0 = _NullClass, typename _Tp1 = _NullClass, + typename _Tp2 = _NullClass, typename _Tp3 = _NullClass, + typename _Tp4 = _NullClass, typename _Tp5 = _NullClass, + typename _Tp6 = _NullClass, typename _Tp7 = _NullClass, + typename _Tp8 = _NullClass, typename _Tp9 = _NullClass> + class tuple; + + /// Gives the type of the ith element of a given tuple type. + template<int __i, typename _Tp> + struct tuple_element; + + /// Finds the size of a given tuple type. + template<typename _Tp> + struct tuple_size; + + // Adds a const reference to a non-reference type. + template<typename _Tp> + struct __add_c_ref + { typedef const _Tp& type; }; + + template<typename _Tp> + struct __add_c_ref<_Tp&> + { typedef _Tp& type; }; + + // Adds a reference to a non-reference type. + template<typename _Tp> + struct __add_ref + { typedef _Tp& type; }; + + template<typename _Tp> + struct __add_ref<_Tp&> + { typedef _Tp& type; }; + + // Class used in the implementation of get + template<int __i, typename _Tp> + struct __get_helper; + + // Returns a const reference to the ith element of a tuple. + // Any const or non-const ref elements are returned with their original type. + template<int __i, typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, + typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, + typename _Tp8, typename _Tp9> + typename __add_ref<typename tuple_element<__i, tuple<_Tp0, _Tp1, _Tp2, + _Tp3, _Tp4, _Tp5, + _Tp6, _Tp7, _Tp8, + _Tp9> >::type>::type + get(tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, + _Tp9>& __t) + { + return __get_helper<__i, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, + _Tp7, _Tp8, _Tp9> >::get_value(__t); + } + + template<int __i, typename _Tp0, typename _Tp1, typename _Tp2, typename _Tp3, + typename _Tp4, typename _Tp5, typename _Tp6, typename _Tp7, + typename _Tp8, typename _Tp9> + typename __add_c_ref<typename tuple_element<__i, tuple<_Tp0, _Tp1, _Tp2, + _Tp3, _Tp4, _Tp5, + _Tp6, _Tp7, _Tp8, + _Tp9> >::type>::type + get(const tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, _Tp7, _Tp8, + _Tp9>& __t) + { + return __get_helper<__i, tuple<_Tp0, _Tp1, _Tp2, _Tp3, _Tp4, _Tp5, _Tp6, + _Tp7, _Tp8, _Tp9> >::get_value(__t); + } + + // This class helps construct the various comparison operations on tuples + template<int __check_equal_size, int __i, int __j, typename _Tp, typename _Up> + struct __tuple_compare; + + template<int __i, int __j, typename _Tp, typename _Up> + struct __tuple_compare<0, __i, __j, _Tp, _Up> + { + static bool __eq(const _Tp& __t, const _Up& __u) + { + return get<__i>(__t) == get<__i>(__u) && + __tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u); + } + static bool __less(const _Tp& __t, const _Up& __u) + { + return (get<__i>(__t) < get<__i>(__u)) || !(get<__i>(__u) < get<__i>(__t)) && + __tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u); + } + }; + + template<int __i, typename _Tp, typename _Up> + struct __tuple_compare<0, __i, __i, _Tp, _Up> + { + static bool __eq(const _Tp&, const _Up&) + { return true; } + static bool __less(const _Tp&, const _Up&) + { return false; } + }; + + template<typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, + typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, + typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, + typename _U6, typename _U7, typename _U8, typename _U9, typename _U10> + bool + operator==(const tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10>& __t, + const tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10>& __u) + { + typedef tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10> _Tp; + typedef tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8,_U9, _U10> _Up; + return __tuple_compare<tuple_size<_Tp>::value - tuple_size<_Tp>::value, 0, + tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u); + } + + template<typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, + typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, + typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, + typename _U6, typename _U7, typename _U8, typename _U9, typename _U10> + bool + operator<(const tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10>& __t, + const tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10>& __u) + { + typedef tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10> _Tp; + typedef tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8,_U9, _U10> _Up; + return __tuple_compare<tuple_size<_Tp>::value - tuple_size<_Tp>::value, 0, + tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u); + } + + template<typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, + typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, + typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, + typename _U6, typename _U7, typename _U8, typename _U9, typename _U10> + bool + operator!=(const tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10>& __t, + const tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10>& __u) + { return !(__t == __u); } + + template<typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, + typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, + typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, + typename _U6, typename _U7, typename _U8, typename _U9, typename _U10> + bool + operator>(const tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10>& __t, + const tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10>& __u) + { return __u < __t; } + + template<typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, + typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, + typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, + typename _U6, typename _U7, typename _U8, typename _U9, typename _U10> + bool + operator<=(const tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10>& __t, + const tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10>& __u) + { return !(__u < __t); } + + template<typename _T1, typename _T2, typename _T3, typename _T4, typename _T5, + typename _T6, typename _T7, typename _T8, typename _T9, typename _T10, + typename _U1, typename _U2, typename _U3, typename _U4, typename _U5, + typename _U6, typename _U7, typename _U8, typename _U9, typename _U10> + bool + operator>=(const tuple<_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10>& __t, + const tuple<_U1, _U2, _U3, _U4, _U5, _U6, _U7, _U8, _U9, _U10>& __u) + { return !(__t < __u); } + + // Helper which adds a reference to a type when given a reference_wrapper + template<typename _Tp> + struct __strip_reference_wrapper + { + typedef _Tp __type; + }; + + template<typename _Tp> + struct __strip_reference_wrapper<reference_wrapper<_Tp> > + { + typedef _Tp& __type; + }; + + template<typename _Tp> + struct __strip_reference_wrapper<const reference_wrapper<_Tp> > + { + typedef _Tp& __type; + }; + + template<typename _Tp0 = _NullClass, typename _Tp1 = _NullClass, + typename _Tp2 = _NullClass, typename _Tp3 = _NullClass, + typename _Tp4 = _NullClass, typename _Tp5 = _NullClass, + typename _Tp6 = _NullClass, typename _Tp7 = _NullClass, + typename _Tp8 = _NullClass, typename _Tp9 = _NullClass> + struct __stripped_tuple_type + { + typedef tuple<typename __strip_reference_wrapper<_Tp0>::__type, + typename __strip_reference_wrapper<_Tp1>::__type, + typename __strip_reference_wrapper<_Tp2>::__type, + typename __strip_reference_wrapper<_Tp3>::__type, + typename __strip_reference_wrapper<_Tp4>::__type, + typename __strip_reference_wrapper<_Tp5>::__type, + typename __strip_reference_wrapper<_Tp6>::__type, + typename __strip_reference_wrapper<_Tp7>::__type, + typename __strip_reference_wrapper<_Tp8>::__type, + typename __strip_reference_wrapper<_Tp9>::__type> __type; + }; + + // A class (and instance) which can be used in 'tie' when an element + // of a tuple is not required + struct swallow_assign + { + template<class T> + swallow_assign& + operator=(const T&) + { return *this; } + }; + + // TODO: Put this in some kind of shared file. + namespace + { + swallow_assign ignore; + }; + +#define _GLIBCXX_CAT(x,y) _GLIBCXX_CAT2(x,y) +#define _GLIBCXX_CAT2(x,y) x##y +#define _SHORT_REPEAT +#define _GLIBCXX_REPEAT_HEADER <tr1/tuple_iterate.h> +#include <tr1/repeat.h> +#undef _GLIBCXX_REPEAT_HEADER +#undef _SHORT_REPEAT } } -#endif +#include <tr1/functional> +#endif diff --git a/libstdc++-v3/include/tr1/tuple_iterate.h b/libstdc++-v3/include/tr1/tuple_iterate.h new file mode 100644 index 00000000000..23cb01fc923 --- /dev/null +++ b/libstdc++-v3/include/tr1/tuple_iterate.h @@ -0,0 +1,158 @@ +// class template tuple -*- C++ -*- + +// 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 +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// 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. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// 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 an internal header file, included by other library headers. + * You should not attempt to use it directly. + */ + +// Chris Jefferson <chris@bubblescope.net> + +/// @brief class tuple_size +template<_GLIBCXX_TEMPLATE_PARAMS> + struct tuple_size<tuple<_GLIBCXX_TEMPLATE_ARGS> > + { static const int value = _GLIBCXX_NUM_ARGS; }; + +template<_GLIBCXX_TEMPLATE_PARAMS> +#ifdef _GLIBCXX_LAST_INCLUDE + class tuple +#else + class tuple<_GLIBCXX_TEMPLATE_ARGS> +#endif + { + _GLIBCXX_BIND_MEMBERS + + public: + tuple() + { } + +#if _GLIBCXX_NUM_ARGS == 2 +template<class _U1, class _U2> + tuple(const std::pair<_U1, _U2>& __u): + _M_arg1(__u.first), _M_arg2(__u.second) + { } + +#endif + +#if _GLIBCXX_NUM_ARGS > 0 + explicit tuple(_GLIBCXX_TUPLE_ADD_CREF) : + _GLIBCXX_BIND_MEMBERS_INIT + { } + + template<_GLIBCXX_TEMPLATE_PARAMS_U> + tuple(const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __in) : + _GLIBCXX_TUPLE_COPY_INIT + { } + + + template<_GLIBCXX_TEMPLATE_PARAMS_U> + tuple& + operator=(const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __in) + { + _GLIBCXX_TUPLE_ASSIGN + return *this; + } + + tuple(const tuple& __in) : + _GLIBCXX_TUPLE_COPY_INIT + { } + +#else + + tuple(const tuple& __in) + { } + +#endif + + tuple& + operator=(const tuple& __in) + { + _GLIBCXX_TUPLE_ASSIGN + return *this; + } + + template<int __i, typename __Type> + friend class __get_helper; + + template<typename, typename, typename, typename, typename, + typename, typename, typename, typename, typename> + friend class tuple; + }; + +#ifndef _GLIBCXX_LAST_INCLUDE + +template<typename _Tp> + struct __get_helper<_GLIBCXX_NUM_ARGS, _Tp> + { + static typename __add_ref<typename tuple_element<_GLIBCXX_NUM_ARGS, + _Tp>::type>::type + get_value(_Tp& __in) + { return __in._GLIBCXX_CAT(_M_arg,_GLIBCXX_NUM_ARGS_PLUS_1); } + + static typename __add_c_ref<typename tuple_element<_GLIBCXX_NUM_ARGS, + _Tp>::type>::type + get_value(const _Tp& __in) + { return __in._GLIBCXX_CAT(_M_arg,_GLIBCXX_NUM_ARGS_PLUS_1); } + }; + +/// @brief class tuple_element +template<typename _T1, typename _T2, typename _T3, typename _T4, + typename _T5, typename _T6, typename _T7, typename _T8, + typename _T9, typename _T10> + struct tuple_element<_GLIBCXX_NUM_ARGS, tuple<_T1, _T2, _T3, _T4, + _T5, _T6, _T7, _T8, _T9, + _T10> > + { typedef _GLIBCXX_T_NUM_ARGS_PLUS_1 type; }; + +#endif +#if _GLIBCXX_NUM_ARGS == 0 + +tuple<> +inline make_tuple() +{ return tuple<>(); } + +inline tuple<> +tie() +{ return tuple<>(); } +#else + +template<_GLIBCXX_TEMPLATE_PARAMS> + typename __stripped_tuple_type<_GLIBCXX_TEMPLATE_ARGS>::__type + make_tuple(_GLIBCXX_PARAMS) + { + return typename __stripped_tuple_type<_GLIBCXX_TEMPLATE_ARGS>:: + __type(_GLIBCXX_ARGS); + } + +template<_GLIBCXX_TEMPLATE_PARAMS> + tuple<_GLIBCXX_REF_TEMPLATE_ARGS> + tie(_GLIBCXX_REF_PARAMS) + { return make_tuple(_GLIBCXX_REF_WRAP_PARAMS); } +#endif + diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits index 55f585f9f4b..176a4c33400 100644 --- a/libstdc++-v3/include/tr1/type_traits +++ b/libstdc++-v3/include/tr1/type_traits @@ -366,14 +366,11 @@ namespace tr1 template<typename _Tp> struct has_trivial_copy - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename _Tp> struct has_trivial_assign - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_const<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename _Tp> struct has_trivial_destructor @@ -385,14 +382,11 @@ namespace tr1 template<typename _Tp> struct has_nothrow_copy - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename _Tp> struct has_nothrow_assign - : public integral_constant<bool, (is_pod<_Tp>::value - && !is_const<_Tp>::value - && !is_volatile<_Tp>::value)> { }; + : public integral_constant<bool, is_pod<_Tp>::value> { }; template<typename> struct has_virtual_destructor @@ -507,7 +501,8 @@ namespace tr1 }; template<typename _From, typename _To, - bool = (is_function<_To>::value || is_array<_To>::value + bool = (is_void<_From>::value || is_void<_To>::value + || is_function<_To>::value || is_array<_To>::value // This special case is here only to avoid warnings. || (is_floating_point<typename remove_reference<_From>::type>::value @@ -521,7 +516,9 @@ namespace tr1 template<typename _From, typename _To> struct __is_convertible_helper<_From, _To, true> - { static const bool __value = __is_int_or_cref<_To>::__value; }; + { static const bool __value = (is_void<_To>::value + || (__is_int_or_cref<_To>::__value + && !is_void<_From>::value)); }; template<typename _From, typename _To> struct is_convertible |