[MLIR][TOSA] Update CustomOp input and output names (#118408)
[llvm-project.git] / libcxx / include / __functional / mem_fn.h
blobf246edb334bb14ca26a5549c027b70ad155fd911
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___FUNCTIONAL_MEM_FN_H
11 #define _LIBCPP___FUNCTIONAL_MEM_FN_H
13 #include <__config>
14 #include <__functional/binary_function.h>
15 #include <__functional/weak_result_type.h>
16 #include <__type_traits/invoke.h>
17 #include <__utility/forward.h>
19 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20 # pragma GCC system_header
21 #endif
23 _LIBCPP_BEGIN_NAMESPACE_STD
25 template <class _Tp>
26 class __mem_fn : public __weak_result_type<_Tp> {
27 public:
28 // types
29 typedef _Tp type;
31 private:
32 type __f_;
34 public:
35 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
37 // invoke
38 template <class... _ArgTypes>
39 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 typename __invoke_of<const _Tp&, _ArgTypes...>::type
40 operator()(_ArgTypes&&... __args) const _NOEXCEPT_(__nothrow_invokable<const _Tp&, _ArgTypes...>::value) {
41 return std::__invoke(__f_, std::forward<_ArgTypes>(__args)...);
45 template <class _Rp, class _Tp>
46 inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __mem_fn<_Rp _Tp::*> mem_fn(_Rp _Tp::*__pm) _NOEXCEPT {
47 return __mem_fn<_Rp _Tp::*>(__pm);
50 _LIBCPP_END_NAMESPACE_STD
52 #endif // _LIBCPP___FUNCTIONAL_MEM_FN_H