Changeset View
Changeset View
Standalone View
Standalone View
libcxx/include/functional
Show First 20 Lines • Show All 3,023 Lines • ▼ Show 20 Lines | struct __perfect_forward_impl<_Op, __tuple_types<_Bound...>, __tuple_indices<_Idxs...>> | ||||
_LIBCPP_INLINE_VISIBILITY constexpr auto operator()(_Args&&... __args) const&& | _LIBCPP_INLINE_VISIBILITY constexpr auto operator()(_Args&&... __args) const&& | ||||
noexcept(noexcept(_Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))..., | noexcept(noexcept(_Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))..., | ||||
_VSTD::forward<_Args>(__args)...))) | _VSTD::forward<_Args>(__args)...))) | ||||
-> decltype( _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))..., | -> decltype( _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))..., | ||||
_VSTD::forward<_Args>(__args)...)) | _VSTD::forward<_Args>(__args)...)) | ||||
{return _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))..., | {return _Op::__call(_VSTD::get<_Idxs>(_VSTD::move(__bound_))..., | ||||
_VSTD::forward<_Args>(__args)...);} | _VSTD::forward<_Args>(__args)...);} | ||||
template<class _Fn = typename tuple_element<0, tuple<_Bound...>>::type, | constexpr __perfect_forward_impl(__perfect_forward_impl const&) = default; | ||||
class = _EnableIf<is_copy_constructible_v<_Fn>>> | constexpr __perfect_forward_impl(__perfect_forward_impl &&) = default; | ||||
constexpr __perfect_forward_impl(__perfect_forward_impl const& __other) | |||||
: __bound_(__other.__bound_) {} | |||||
template<class _Fn = typename tuple_element<0, tuple<_Bound...>>::type, | |||||
class = _EnableIf<is_move_constructible_v<_Fn>>> | |||||
constexpr __perfect_forward_impl(__perfect_forward_impl && __other) | |||||
: __bound_(_VSTD::move(__other.__bound_)) {} | |||||
template<class... _BoundArgs> | template<class... _BoundArgs, class = _EnableIf< | ||||
is_constructible<tuple<_Bound...>, _BoundArgs&&...>::value | |||||
>> | |||||
ldionne: This change is necessary for the PSTL tests to succeed.
I am fairly certain that we can reduce… | |||||
cjdbUnsubmitted Not Done ReplyInline ActionsDo we need to add any tests to account for this change? cjdb: Do we need to add any tests to account for this change? | |||||
ldionneUnsubmitted Yes, I was asking @zoecarver to look into the failure and add tests for std::not_fn and std::bind_front based on the findings! ldionne: Yes, I was asking @zoecarver to look into the failure and add tests for `std::not_fn` and `std… | |||||
explicit constexpr __perfect_forward_impl(_BoundArgs&&... __bound) : | explicit constexpr __perfect_forward_impl(_BoundArgs&&... __bound) : | ||||
__bound_(_VSTD::forward<_BoundArgs>(__bound)...) { } | __bound_(_VSTD::forward<_BoundArgs>(__bound)...) { } | ||||
}; | }; | ||||
template<class _Op, class... _Args> | template<class _Op, class... _Args> | ||||
using __perfect_forward = | using __perfect_forward = | ||||
__perfect_forward_impl<_Op, __tuple_types<decay_t<_Args>...>>; | __perfect_forward_impl<_Op, __tuple_types<decay_t<_Args>...>>; | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |
This change is necessary for the PSTL tests to succeed.
I am fairly certain that we can reduce that failure sufficiently to show that we actually have a bug in std::not_fn. @zoecarver would you be able to take a look since you implemented __perfect_forward_impl?