2019-04-24 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/tuple (apply): Use remove_reference_t instead of decay_t
+ as per P0777R1.
+ * include/std/type_traits (__result_of_memfun): Use remove_reference
+ instead of __remove_cvref_t and remove redundant is_same check.
+ (__inv_unwrap): Use __remove_cvref_t instead of decay_t.
+
* include/experimental/string_view (basic_string_view::pointer)
(basic_string_view::reference): Fix to refer to non-const value_type.
* include/bits/basic_string.h (basic_string): Use __sv_check and
second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
{ }
-#if __cplusplus > 201402L
+#if __cplusplus >= 201703L
# define __cpp_lib_apply 201603
template <typename _Fn, typename _Tuple, size_t... _Idx>
constexpr decltype(auto)
apply(_Fn&& __f, _Tuple&& __t)
{
- using _Indices = make_index_sequence<tuple_size_v<decay_t<_Tuple>>>;
+ using _Indices
+ = make_index_sequence<tuple_size_v<remove_reference_t<_Tuple>>>;
return std::__apply_impl(std::forward<_Fn>(__f),
std::forward<_Tuple>(__t),
_Indices{});
template<typename _Res, typename _Class, typename _Arg, typename... _Args>
struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
{
- typedef __remove_cvref_t<_Arg> _Argval;
+ typedef typename remove_reference<_Arg>::type _Argval;
typedef _Res _Class::* _MemPtr;
- typedef typename conditional<__or_<is_same<_Argval, _Class>,
- is_base_of<_Class, _Argval>>::value,
+ typedef typename conditional<is_base_of<_Class, _Argval>::value,
__result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
__result_of_memfun_deref<_MemPtr, _Arg, _Args...>
>::type::type type;
// as the object expression
// Used by result_of, invoke etc. to unwrap a reference_wrapper.
- template<typename _Tp, typename _Up = typename decay<_Tp>::type>
+ template<typename _Tp, typename _Up = __remove_cvref_t<_Tp>>
struct __inv_unwrap
{
using type = _Tp;