diff options
Diffstat (limited to 'libcxx/include/__functional/bind.h')
-rw-r--r-- | libcxx/include/__functional/bind.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h index 596cce0..def9e4c 100644 --- a/libcxx/include/__functional/bind.h +++ b/libcxx/include/__functional/bind.h @@ -83,15 +83,14 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Tp& __mu(reference_w template <class _Ti, class... _Uj, size_t... _Indx> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<_Ti&, _Uj...> -__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) { +__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __index_sequence<_Indx...>) { return __ti(std::forward<_Uj>(std::get<_Indx>(__uj))...); } template <class _Ti, class... _Uj, __enable_if_t<is_bind_expression<_Ti>::value, int> = 0> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __invoke_result_t<_Ti&, _Uj...> __mu(_Ti& __ti, tuple<_Uj...>& __uj) { - typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices; - return std::__mu_expand(__ti, __uj, __indices()); + return std::__mu_expand(__ti, __uj, __make_index_sequence<sizeof...(_Uj)>()); } template <bool _IsPh, class _Ti, class _Uj> @@ -191,7 +190,7 @@ struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true> { template <class _Fp, class _BoundArgs, size_t... _Indx, class _Args> inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fp, _BoundArgs, _Args>::type -__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>, _Args&& __args) { +__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __index_sequence<_Indx...>, _Args&& __args) { return std::__invoke(__f, std::__mu(std::get<_Indx>(__bound_args), __args)...); } @@ -205,8 +204,6 @@ private: _Fd __f_; _Td __bound_args_; - typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices; - public: template < class _Gp, @@ -219,14 +216,22 @@ public: template <class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type operator()(_Args&&... __args) { - return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...)); + return std::__apply_functor( + __f_, + __bound_args_, + __make_index_sequence<sizeof...(_BoundArgs)>(), + tuple<_Args&&...>(std::forward<_Args>(__args)...)); } template <class... _Args> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type operator()(_Args&&... __args) const { - return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...)); + return std::__apply_functor( + __f_, + __bound_args_, + __make_index_sequence<sizeof...(_BoundArgs)>(), + tuple<_Args&&...>(std::forward<_Args>(__args)...)); } }; |