Skip to content

[libc++] Fix expression-equivalence for mem_fn #111307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions libcxx/include/__functional/mem_fn.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ class __mem_fn : public __weak_result_type<_Tp> {

// invoke
template <class... _ArgTypes>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20

typename __invoke_return<type, _ArgTypes...>::type
operator()(_ArgTypes&&... __args) const {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<const _Tp&, _ArgTypes...>::type
operator()(_ArgTypes&&... __args) const _NOEXCEPT_(__nothrow_invokable<const _Tp&, _ArgTypes...>::value) {
return std::__invoke(__f_, std::forward<_ArgTypes>(__args)...);
}
};
Expand Down
5 changes: 0 additions & 5 deletions libcxx/include/__functional/weak_result_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,6 @@ struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const volatile> {
#endif
};

template <class _Tp, class... _Args>
struct __invoke_return {
typedef decltype(std::__invoke(std::declval<_Tp>(), std::declval<_Args>()...)) type;
};

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP___FUNCTIONAL_WEAK_RESULT_TYPE_H
2 changes: 1 addition & 1 deletion libcxx/include/functional
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ const_mem_fun_ref_t<S,T> mem_fun_ref(S (T::*f)() const);
template <class S, class T, class A>
const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17

template<class R, class T> constexpr unspecified mem_fn(R T::*); // constexpr in C++20
template<class R, class T> constexpr unspecified mem_fn(R T::*) noexcept; // constexpr in C++20

class bad_function_call
: public exception
Expand Down
Loading
Loading