From: Jonathan Wakely Date: Fri, 19 Jun 2020 14:02:54 +0000 (+0100) Subject: libstdc++: Remove redundant std:: qualification X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7a3932e4b698f205273cfa78c7aa8ab6840542a;p=gcc.git libstdc++: Remove redundant std:: qualification * include/bits/stl_pair.h (_Index_tuple): Remove redundant namespace qualification. (pair::pair(tuple<>&, tuple<>&, _Index_tuple, _Index_tuple)): Likewise. * include/std/tuple (_Head_base, _Tuple_impl, tuple_size) (tuple_element, __get_helper, get, __make_tuple_impl) (__make_1st_indices, __tuple_concater) (pair::pair(tuple<>&, tuple<>&, _Index_tuple, _Index_tuple)): Likewise. * include/std/utility (tuple_element, __is_tuple_like_impl) (tuple_size, __pair_get, get): Likewise. --- diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index 491c599076e..e5669d5d7ae 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -89,7 +89,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template class tuple; - template + template struct _Index_tuple; // Concept utility functions, reused in conditionally-explicit @@ -446,11 +446,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } private: - template + template _GLIBCXX20_CONSTEXPR pair(tuple<_Args1...>&, tuple<_Args2...>&, - _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>); + _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>); #endif // C++11 }; diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index db4872d3a52..726ad0aabbb 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -69,11 +69,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION = typename conditional<__is_final(_Tp), false_type, __is_empty_non_tuple<_Tp>>::type; - template::value> struct _Head_base; - template + template struct _Head_base<_Idx, _Head, true> : public _Head { @@ -120,7 +120,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_head(const _Head_base& __b) noexcept { return __b; } }; - template + template struct _Head_base<_Idx, _Head, false> { constexpr _Head_base() @@ -179,7 +179,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * point in the hierarchy; we use it to implement a constant-time * get() operation. */ - template + template struct _Tuple_impl; /** @@ -187,12 +187,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * and derive from a @c Tuple_impl containing the remaining elements * (which contains the @c Tail). */ - template + template struct _Tuple_impl<_Idx, _Head, _Tail...> : public _Tuple_impl<_Idx + 1, _Tail...>, private _Head_base<_Idx, _Head> { - template friend class _Tuple_impl; + template friend class _Tuple_impl; typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited; typedef _Head_base<_Idx, _Head> _Base; @@ -337,11 +337,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; // Basis case of inheritance recursion. - template + template struct _Tuple_impl<_Idx, _Head> : private _Head_base<_Idx, _Head> { - template friend class _Tuple_impl; + template friend class _Tuple_impl; typedef _Head_base<_Idx, _Head> _Base; @@ -1244,7 +1244,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// class tuple_size template struct tuple_size> - : public integral_constant { }; + : public integral_constant { }; #if __cplusplus > 201402L template @@ -1255,7 +1255,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * Recursive case for tuple_element: strip off the first element in * the tuple and retrieve the (i-1)th element of the remaining tuple. */ - template + template struct tuple_element<__i, tuple<_Head, _Tail...> > : tuple_element<__i - 1, tuple<_Tail...> > { }; @@ -1278,30 +1278,30 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "tuple index is in range"); }; - template + template constexpr _Head& __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } - template + template constexpr const _Head& __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); } /// Return a reference to the ith element of a tuple. - template + template constexpr __tuple_element_t<__i, tuple<_Elements...>>& get(tuple<_Elements...>& __t) noexcept { return std::__get_helper<__i>(__t); } /// Return a const reference to the ith element of a const tuple. - template + template constexpr const __tuple_element_t<__i, tuple<_Elements...>>& get(const tuple<_Elements...>& __t) noexcept { return std::__get_helper<__i>(__t); } /// Return an rvalue reference to the ith element of a tuple rvalue. - template + template constexpr __tuple_element_t<__i, tuple<_Elements...>>&& get(tuple<_Elements...>&& __t) noexcept { @@ -1310,7 +1310,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /// Return a const rvalue reference to the ith element of a const tuple rvalue. - template + template constexpr const __tuple_element_t<__i, tuple<_Elements...>>&& get(const tuple<_Elements...>&& __t) noexcept { @@ -1496,7 +1496,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Tuple, _Nm> { }; - template + template struct __make_tuple_impl<_Nm, tuple<_Tp...>, _Tuple, _Nm> { typedef tuple<_Tp...> __type; @@ -1504,7 +1504,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __do_make_tuple - : __make_tuple_impl<0, tuple<>, _Tuple, std::tuple_size<_Tuple>::value> + : __make_tuple_impl<0, tuple<>, _Tuple, tuple_size<_Tuple>::value> { }; // Returns the std::tuple equivalent of a tuple-like type. @@ -1552,14 +1552,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<> struct __make_1st_indices<> { - typedef std::_Index_tuple<> __type; + typedef _Index_tuple<> __type; }; template struct __make_1st_indices<_Tp, _Tpls...> { - typedef typename std::_Build_index_tuple::type>::value>::__type __type; + typedef typename _Build_index_tuple::type>::value>::__type __type; }; // Performs the actual concatenation by step-wise expanding tuple-like @@ -1568,8 +1568,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __tuple_concater; - template - struct __tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...> + template + struct __tuple_concater<_Ret, _Index_tuple<_Is...>, _Tp, _Tpls...> { template static constexpr _Ret @@ -1584,7 +1584,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; template - struct __tuple_concater<_Ret, std::_Index_tuple<>> + struct __tuple_concater<_Ret, _Index_tuple<>> { template static constexpr _Ret @@ -1679,14 +1679,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { } template - template + template _GLIBCXX20_CONSTEXPR inline pair<_T1, _T2>:: pair(tuple<_Args1...>& __tuple1, tuple<_Args2...>& __tuple2, _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>) : first(std::forward<_Args1>(std::get<_Indexes1>(__tuple1))...), - second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...) + second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...) { } #if __cplusplus >= 201703L diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 5f1675a7679..cde375259f7 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -110,26 +110,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public tuple_size<_Tp> { }; /// Gives the type of the ith element of a given tuple type. - template + template struct tuple_element; // Duplicate of C++14's tuple_element_t for internal use in C++11 mode - template + template using __tuple_element_t = typename tuple_element<__i, _Tp>::type; - template + template struct tuple_element<__i, const _Tp> { typedef typename add_const<__tuple_element_t<__i, _Tp>>::type type; }; - template + template struct tuple_element<__i, volatile _Tp> { typedef typename add_volatile<__tuple_element_t<__i, _Tp>>::type type; }; - template + template struct tuple_element<__i, const volatile _Tp> { typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type; @@ -141,7 +141,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // of tuple_element> and tuple_element> are defined. #define __cpp_lib_tuple_element_t 201402L - template + template using tuple_element_t = typename tuple_element<__i, _Tp>::type; #endif @@ -149,93 +149,93 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// Partial specialization for std::pair template - struct __is_tuple_like_impl> : true_type + struct __is_tuple_like_impl> : true_type { }; /// Partial specialization for std::pair template - struct tuple_size> - : public integral_constant { }; + struct tuple_size> + : public integral_constant { }; /// Partial specialization for std::pair template - struct tuple_element<0, std::pair<_Tp1, _Tp2>> + struct tuple_element<0, pair<_Tp1, _Tp2>> { typedef _Tp1 type; }; /// Partial specialization for std::pair template - struct tuple_element<1, std::pair<_Tp1, _Tp2>> + struct tuple_element<1, pair<_Tp1, _Tp2>> { typedef _Tp2 type; }; - template + template struct __pair_get; template<> struct __pair_get<0> { template - static constexpr _Tp1& - __get(std::pair<_Tp1, _Tp2>& __pair) noexcept - { return __pair.first; } + static constexpr _Tp1& + __get(pair<_Tp1, _Tp2>& __pair) noexcept + { return __pair.first; } template - static constexpr _Tp1&& - __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept - { return std::forward<_Tp1>(__pair.first); } + static constexpr _Tp1&& + __move_get(pair<_Tp1, _Tp2>&& __pair) noexcept + { return std::forward<_Tp1>(__pair.first); } template - static constexpr const _Tp1& - __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept - { return __pair.first; } + static constexpr const _Tp1& + __const_get(const pair<_Tp1, _Tp2>& __pair) noexcept + { return __pair.first; } template - static constexpr const _Tp1&& - __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept - { return std::forward(__pair.first); } + static constexpr const _Tp1&& + __const_move_get(const pair<_Tp1, _Tp2>&& __pair) noexcept + { return std::forward(__pair.first); } }; template<> struct __pair_get<1> { template - static constexpr _Tp2& - __get(std::pair<_Tp1, _Tp2>& __pair) noexcept - { return __pair.second; } + static constexpr _Tp2& + __get(pair<_Tp1, _Tp2>& __pair) noexcept + { return __pair.second; } template - static constexpr _Tp2&& - __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept - { return std::forward<_Tp2>(__pair.second); } + static constexpr _Tp2&& + __move_get(pair<_Tp1, _Tp2>&& __pair) noexcept + { return std::forward<_Tp2>(__pair.second); } template - static constexpr const _Tp2& - __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept - { return __pair.second; } + static constexpr const _Tp2& + __const_get(const pair<_Tp1, _Tp2>& __pair) noexcept + { return __pair.second; } template - static constexpr const _Tp2&& - __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept - { return std::forward(__pair.second); } + static constexpr const _Tp2&& + __const_move_get(const pair<_Tp1, _Tp2>&& __pair) noexcept + { return std::forward(__pair.second); } }; - template - constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& - get(std::pair<_Tp1, _Tp2>& __in) noexcept + template + constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& + get(pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__get(__in); } - template - constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&& - get(std::pair<_Tp1, _Tp2>&& __in) noexcept + template + constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&& + get(pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__move_get(std::move(__in)); } - template - constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& - get(const std::pair<_Tp1, _Tp2>& __in) noexcept + template + constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type& + get(const pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__const_get(__in); } - template - constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&& - get(const std::pair<_Tp1, _Tp2>&& __in) noexcept + template + constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&& + get(const pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__const_move_get(std::move(__in)); } #if __cplusplus >= 201402L