From 6f86467975d959c1da841dc6f2df8cc90b7da489 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 30 Jun 2015 14:35:36 +0100 Subject: [PATCH] * include/bits/stl_pair.h: Replace class keyword with typename. From-SVN: r225190 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/include/bits/stl_pair.h | 46 ++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3a3192f..e2d1f51 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2015-06-30 Jonathan Wakely + + * include/bits/stl_pair.h: Replace class keyword with typename. + 2015-06-30 Ville Voutilainen Implement N4387, "Improving pair and tuple", and LWG 2367. diff --git a/libstdc++-v3/include/bits/stl_pair.h b/libstdc++-v3/include/bits/stl_pair.h index 6672ecb..a5a7898 100644 --- a/libstdc++-v3/include/bits/stl_pair.h +++ b/libstdc++-v3/include/bits/stl_pair.h @@ -124,7 +124,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @tparam _T1 Type of first object. * @tparam _T2 Type of second object. */ - template + template struct pair { typedef _T1 first_type; /// @c first_type is the first bound type @@ -170,18 +170,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /** There is also a templated copy ctor for the @c pair class itself. */ #if __cplusplus < 201103L - template + template pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) { } #else - template() && _ImplicitlyConvertiblePair<_T1, _T2, _U1, _U2>(), bool>::type=true> constexpr pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) { } - template() && !_ImplicitlyConvertiblePair<_T1, _T2, _U1, _U2>(), bool>::type=false> @@ -192,7 +192,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr pair(pair&&) = default; // DR 811. - template() && _MoveConstructiblePair<_T1, _T2, _U1, _T2>() && _ImplicitlyConvertiblePair<_T2, _T2, _T2, _T2>() @@ -202,7 +202,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr pair(_U1&& __x, const _T2& __y) : first(std::forward<_U1>(__x)), second(__y) { } - template() && _MoveConstructiblePair<_T1, _T2, _U1, _T2>() && (!_ImplicitlyConvertiblePair<_T2, _T2, _T2, _T2>() @@ -212,7 +212,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION explicit constexpr pair(_U1&& __x, const _T2& __y) : first(std::forward<_U1>(__x)), second(__y) { } - template() && _MoveConstructiblePair<_T1, _T2, _T1, _U2>() && _ImplicitlyConvertiblePair<_T1, _T1, _T1, _T1>() @@ -222,7 +222,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr pair(const _T1& __x, _U2&& __y) : first(__x), second(std::forward<_U2>(__y)) { } - template() && _MoveConstructiblePair<_T1, _T2, _T1, _U2>() && (!_ImplicitlyConvertiblePair<_T1, _T1, _T1, _T1>() @@ -232,7 +232,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION explicit pair(const _T1& __x, _U2&& __y) : first(__x), second(std::forward<_U2>(__y)) { } - template() && _ImplicitlyMoveConvertiblePair<_T1, _T2, _U1, _U2>(), @@ -240,7 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr pair(_U1&& __x, _U2&& __y) : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { } - template() && !_ImplicitlyMoveConvertiblePair<_T1, _T2, _U1, _U2>(), @@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { } - template() && _ImplicitlyMoveConvertiblePair<_T1, _T2, _U1, _U2>(), @@ -258,7 +258,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) { } - template() && !_ImplicitlyMoveConvertiblePair<_T1, _T2, _U1, _U2>(), @@ -288,7 +288,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } - template + template pair& operator=(const pair<_U1, _U2>& __p) { @@ -297,7 +297,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *this; } - template + template pair& operator=(pair<_U1, _U2>&& __p) { @@ -325,38 +325,38 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION }; /// Two pairs of the same type are equal iff their members are equal. - template + template inline _GLIBCXX_CONSTEXPR bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first == __y.first && __x.second == __y.second; } /// - template + template inline _GLIBCXX_CONSTEXPR bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); } /// Uses @c operator== to find the result. - template + template inline _GLIBCXX_CONSTEXPR bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x == __y); } /// Uses @c operator< to find the result. - template + template inline _GLIBCXX_CONSTEXPR bool operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __y < __x; } /// Uses @c operator< to find the result. - template + template inline _GLIBCXX_CONSTEXPR bool operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__y < __x); } /// Uses @c operator< to find the result. - template + template inline _GLIBCXX_CONSTEXPR bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x < __y); } @@ -365,7 +365,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /// See std::pair::swap(). // Note: no std::swap overloads in C++03 mode, this has performance // implications, see, eg, libstdc++/38466. - template + template inline void swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) @@ -386,7 +386,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 181. make_pair() unintended behavior #if __cplusplus >= 201103L // NB: DR 706. - template + template constexpr pair::__type, typename __decay_and_strip<_T2>::__type> make_pair(_T1&& __x, _T2&& __y) @@ -397,7 +397,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y)); } #else - template + template inline pair<_T1, _T2> make_pair(_T1 __x, _T2 __y) { return pair<_T1, _T2>(__x, __y); } -- 2.7.4