From: Paolo Carlini Date: Sat, 10 Sep 2011 00:47:02 +0000 (+0000) Subject: tuple: Use everywhere std::size_t... X-Git-Tag: releases/gcc-4.7.0~3831 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=049d28935129d6c2daa4993899f25a27e7b239af;p=thirdparty%2Fgcc.git tuple: Use everywhere std::size_t... 2011-09-09 Paolo Carlini * include/std/tuple: Use everywhere std::size_t... instead of int... * include/std/functional: Likewise. * include/std/scoped_allocator: Likewise. * include/bits/stl_pair.h: Likewise. From-SVN: r178746 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ac4215cc8675..64f7551cc37c 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2011-09-09 Paolo Carlini + + * include/std/tuple: Use everywhere std::size_t... instead of int... + * include/std/functional: Likewise. + * include/std/scoped_allocator: Likewise. + * include/bits/stl_pair.h: Likewise. + 2011-09-09 Paolo Carlini PR libstdc++/50336 diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index c4f33d0dcf68..bb33cc6437d9 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -79,7 +79,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template class tuple; - template + template struct _Index_tuple; #endif @@ -206,7 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static _Tp __cons(tuple<_Args...>&&); - template + template static _Tp __do_cons(tuple<_Args...>&&, const _Index_tuple<_Indexes...>&); #endif diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 9296d755faae..4a04eca89697 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -914,7 +914,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) * template handles the case where it is safe to use @c * tuple_element. */ - template + template struct _Safe_tuple_element_impl : tuple_element<__i, _Tuple> { }; @@ -923,7 +923,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) * specialization handles the case where it is not safe to use @c * tuple_element. We just return @c _No_tuple_element. */ - template + template struct _Safe_tuple_element_impl<__i, _Tuple, false> { typedef _No_tuple_element type; @@ -933,10 +933,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) * Like tuple_element, but returns @c _No_tuple_element when * tuple_element would return an error. */ - template + template struct _Safe_tuple_element : _Safe_tuple_element_impl<__i, _Tuple, - (__i >= 0 && __i < tuple_size<_Tuple>::value)> + (__i < tuple_size<_Tuple>::value)> { }; /** @@ -999,7 +999,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) private: // Invokes the underlying function object __arg by unpacking all // of the arguments in the tuple. - template + template auto __call(_CVArg& __arg, tuple<_Args...>& __tuple, const _Index_tuple<_Indexes...>&) const volatile @@ -1112,14 +1112,14 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) }; // std::get for volatile-qualified tuples - template + template inline auto __volget(volatile tuple<_Tp...>& __tuple) -> typename tuple_element<_Ind, tuple<_Tp...>>::type volatile& { return std::get<_Ind>(const_cast&>(__tuple)); } // std::get for const-volatile-qualified tuples - template + template inline auto __volget(const volatile tuple<_Tp...>& __tuple) -> typename tuple_element<_Ind, tuple<_Tp...>>::type const volatile& @@ -1141,7 +1141,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) tuple<_Bound_args...> _M_bound_args; // Call unqualified - template + template _Result __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) { @@ -1150,7 +1150,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as const - template + template _Result __call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const { @@ -1159,7 +1159,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as volatile - template + template _Result __call_v(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) volatile @@ -1169,7 +1169,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as const volatile - template + template _Result __call_c_v(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const volatile @@ -1272,7 +1272,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) struct __disable_if_void : enable_if::value, int> { }; // Call unqualified - template + template _Result __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __disable_if_void<_Res>::type = 0) @@ -1282,7 +1282,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call unqualified, return void - template + template void __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __enable_if_void<_Res>::type = 0) @@ -1292,7 +1292,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as const - template + template _Result __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __disable_if_void<_Res>::type = 0) const @@ -1302,7 +1302,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as const, return void - template + template void __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __enable_if_void<_Res>::type = 0) const @@ -1312,7 +1312,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as volatile - template + template _Result __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __disable_if_void<_Res>::type = 0) volatile @@ -1322,7 +1322,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as volatile, return void - template + template void __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __enable_if_void<_Res>::type = 0) volatile @@ -1332,7 +1332,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as const volatile - template + template _Result __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, typename __disable_if_void<_Res>::type = 0) const volatile @@ -1342,7 +1342,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } // Call as const volatile, return void - template + template void __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>, @@ -1533,7 +1533,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) private: - template + template typename result_of<_Callable(_Args...)>::type _M_invoke(_Index_tuple<_Indices...>) { diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator index bebbbd29cc98..9fd53db6133a 100644 --- a/libstdc++-v3/include/std/scoped_allocator +++ b/libstdc++-v3/include/std/scoped_allocator @@ -234,7 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __a_traits::select_on_container_copy_construction(__a); } - template + template scoped_allocator_adaptor(tuple __refs, _Index_tuple<_Indices...>) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index f68766f57477..515fb4ea0011 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1011,7 +1011,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Stores a tuple of indices. Used by bind() to extract the elements * in a tuple. */ - template + template struct _Index_tuple { typedef _Index_tuple<_Indexes..., sizeof...(_Indexes)> __next; @@ -1042,7 +1042,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } template - template + template inline _Tp pair<_T1, _T2>::__do_cons(tuple<_Args...>&& __tuple, const _Index_tuple<_Indexes...>&)