diff options
| author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-18 08:36:06 +0000 |
|---|---|---|
| committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-18 08:36:06 +0000 |
| commit | a558fd42873865cc1e93a5916713f850c510d76e (patch) | |
| tree | 4b2998e8222d758131a6b3f6b82324e81255caff /libstdc++-v3/include/std/tuple | |
| parent | ef5c7840b2f35bc1d07401510d60f458bcfc23cd (diff) | |
| download | ppe42-gcc-a558fd42873865cc1e93a5916713f850c510d76e.tar.gz ppe42-gcc-a558fd42873865cc1e93a5916713f850c510d76e.zip | |
2012-10-17 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/move.h (move_if_noexcept): Mark constexpr.
* include/std/array (front, back): Same.
* include/std/chrono: Add comment.
* include/std/tuple (__tuple_compare): Mark __eq, __less constexpr.
(operator ==, <, >, !=, <=, >=): Same.
* testsuite/20_util/forward/c_neg.cc: Adjust line numbers.
* testsuite/20_util/forward/f_neg.cc: Same.
* testsuite/20_util/move_if_noexcept/constexpr.cc: New.
* testsuite/20_util/tuple/comparison_operators/constexpr.cc: New.
* testsuite/20_util/tuple/creation_functions/constexpr.cc: Add.
* testsuite/23_containers/array/element_access/
constexpr_element_access.cc: Same.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust
line numbers.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Same.
* testsuite/20_util/tuple/comparison_operators/35480_neg.cc:
Temporarily add dg-excess-errors.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192556 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/tuple')
| -rw-r--r-- | libstdc++-v3/include/std/tuple | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index fb9e09fffe8..b4985d280d8 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -775,14 +775,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<std::size_t __i, std::size_t __j, typename _Tp, typename _Up> struct __tuple_compare<0, __i, __j, _Tp, _Up> { - static bool + static constexpr 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 + static constexpr bool __less(const _Tp& __t, const _Up& __u) { return ((get<__i>(__t) < get<__i>(__u)) @@ -794,55 +794,55 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<std::size_t __i, typename _Tp, typename _Up> struct __tuple_compare<0, __i, __i, _Tp, _Up> { - static bool + static constexpr bool __eq(const _Tp&, const _Up&) { return true; } - static bool + static constexpr bool __less(const _Tp&, const _Up&) { return false; } }; template<typename... _TElements, typename... _UElements> - bool + constexpr bool operator==(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { typedef tuple<_TElements...> _Tp; typedef tuple<_UElements...> _Up; - return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value, + return bool(__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value, 0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u)); } template<typename... _TElements, typename... _UElements> - bool + constexpr bool operator<(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { typedef tuple<_TElements...> _Tp; typedef tuple<_UElements...> _Up; - return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value, + return bool(__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value, 0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u)); } template<typename... _TElements, typename... _UElements> - inline bool + inline constexpr bool operator!=(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return !(__t == __u); } template<typename... _TElements, typename... _UElements> - inline bool + inline constexpr bool operator>(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return __u < __t; } template<typename... _TElements, typename... _UElements> - inline bool + inline constexpr bool operator<=(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return !(__u < __t); } template<typename... _TElements, typename... _UElements> - inline bool + inline constexpr bool operator>=(const tuple<_TElements...>& __t, const tuple<_UElements...>& __u) { return !(__t < __u); } @@ -858,7 +858,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } template<typename... _Elements> - constexpr tuple<_Elements&&...> + tuple<_Elements&&...> forward_as_tuple(_Elements&&... __args) noexcept { return tuple<_Elements&&...>(std::forward<_Elements>(__args)...); } |

