Commit af222e74 by Jonathan Wakely Committed by Jonathan Wakely

tuple (__add_c_ref, [...]): Remove.

	* include/std/tuple (__add_c_ref, __add_ref, __add_r_ref): Remove.
	(__tuple_element_t): Define.
	(tuple_element): Use __tuple_element_t.
	(__cv_tuple_size): Define.
	(tuple_size<cv _Tp>): Use __cv_tuple_size.
	(get, __get_helper, __get_helper2): Remove uses of __add_ref etc.
	(get<_Tp>(tuple<_Types...>&&)): Use forward instead of move.
	(__tuple_compare): Remove size check, re-order parameters.
	(operator==, operator<): Use static_assert to check requirements.
	* include/std/functional (__volget): use __tuple_element_t.
	* testsuite/20_util/tuple/element_access/get_by_type.cc: Test rvalues.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error.

From-SVN: r210447
parent 88fe5e91
2014-05-14 Jonathan Wakely <jwakely@redhat.com>
* include/std/tuple (__add_c_ref, __add_ref, __add_r_ref): Remove.
(__tuple_element_t): Define.
(tuple_element): Use __tuple_element_t.
(__cv_tuple_size): Define.
(tuple_size<cv _Tp>): Use __cv_tuple_size.
(get, __get_helper, __get_helper2): Remove uses of __add_ref etc.
(get<_Tp>(tuple<_Types...>&&)): Use forward instead of move.
(__tuple_compare): Remove size check, re-order parameters.
(operator==, operator<): Use static_assert to check requirements.
* include/std/functional (__volget): use __tuple_element_t.
* testsuite/20_util/tuple/element_access/get_by_type.cc: Test rvalues.
* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error.
2014-05-13 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/60497
......
......@@ -1230,14 +1230,14 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
template<std::size_t _Ind, typename... _Tp>
inline auto
__volget(volatile tuple<_Tp...>& __tuple)
-> typename tuple_element<_Ind, tuple<_Tp...>>::type volatile&
-> __tuple_element_t<_Ind, tuple<_Tp...>> volatile&
{ return std::get<_Ind>(const_cast<tuple<_Tp...>&>(__tuple)); }
// std::get<I> for const-volatile-qualified tuples
template<std::size_t _Ind, typename... _Tp>
inline auto
__volget(const volatile tuple<_Tp...>& __tuple)
-> typename tuple_element<_Ind, tuple<_Tp...>>::type const volatile&
-> __tuple_element_t<_Ind, tuple<_Tp...>> const volatile&
{ return std::get<_Ind>(const_cast<const tuple<_Tp...>&>(__tuple)); }
/// Type of the function object returned from bind().
......
......@@ -41,4 +41,8 @@ main()
get<1>(b)=5;
VERIFY(get<int>(b)==1 && get<int&>(b)==5 && get<const int&>(b)==2);
VERIFY(j==5);
// test rvalue overload:
VERIFY(get<int>(std::move(b))==1);
VERIFY(get<int&>(std::move(b))==5);
VERIFY(get<const int&>(std::move(b))==2);
}
......@@ -44,4 +44,4 @@ void test01()
tuple<Type> t(allocator_arg, a, 1);
}
// { dg-error "no matching function" "" { target *-*-* } 118 }
// { dg-error "no matching function" "" { target *-*-* } 91 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment