[lld][WebAssembly] Reinstate mistakenly disabled test. NFC
[llvm-project.git] / libcxx / include / __functional / mem_fun_ref.h
blob830936c1b0e5ef9a59b5e0508974388a6a884cb6
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_FUN_REF_H
11 #define _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H
13 #include <__config>
14 #include <__functional/binary_function.h>
15 #include <__functional/unary_function.h>
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #pragma GCC system_header
19 #endif
21 _LIBCPP_BEGIN_NAMESPACE_STD
23 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
25 template<class _Sp, class _Tp>
26 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_t
27 : public unary_function<_Tp*, _Sp>
29 _Sp (_Tp::*__p_)();
30 public:
31 _LIBCPP_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)())
32 : __p_(__p) {}
33 _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const
34 {return (__p->*__p_)();}
37 template<class _Sp, class _Tp, class _Ap>
38 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_t
39 : public binary_function<_Tp*, _Ap, _Sp>
41 _Sp (_Tp::*__p_)(_Ap);
42 public:
43 _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap))
44 : __p_(__p) {}
45 _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const
46 {return (__p->*__p_)(__x);}
49 template<class _Sp, class _Tp>
50 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
51 mem_fun_t<_Sp,_Tp>
52 mem_fun(_Sp (_Tp::*__f)())
53 {return mem_fun_t<_Sp,_Tp>(__f);}
55 template<class _Sp, class _Tp, class _Ap>
56 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
57 mem_fun1_t<_Sp,_Tp,_Ap>
58 mem_fun(_Sp (_Tp::*__f)(_Ap))
59 {return mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
61 template<class _Sp, class _Tp>
62 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun_ref_t
63 : public unary_function<_Tp, _Sp>
65 _Sp (_Tp::*__p_)();
66 public:
67 _LIBCPP_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)())
68 : __p_(__p) {}
69 _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const
70 {return (__p.*__p_)();}
73 template<class _Sp, class _Tp, class _Ap>
74 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 mem_fun1_ref_t
75 : public binary_function<_Tp, _Ap, _Sp>
77 _Sp (_Tp::*__p_)(_Ap);
78 public:
79 _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap))
80 : __p_(__p) {}
81 _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const
82 {return (__p.*__p_)(__x);}
85 template<class _Sp, class _Tp>
86 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
87 mem_fun_ref_t<_Sp,_Tp>
88 mem_fun_ref(_Sp (_Tp::*__f)())
89 {return mem_fun_ref_t<_Sp,_Tp>(__f);}
91 template<class _Sp, class _Tp, class _Ap>
92 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
93 mem_fun1_ref_t<_Sp,_Tp,_Ap>
94 mem_fun_ref(_Sp (_Tp::*__f)(_Ap))
95 {return mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
97 template <class _Sp, class _Tp>
98 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_t
99 : public unary_function<const _Tp*, _Sp>
101 _Sp (_Tp::*__p_)() const;
102 public:
103 _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const)
104 : __p_(__p) {}
105 _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const
106 {return (__p->*__p_)();}
109 template <class _Sp, class _Tp, class _Ap>
110 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_t
111 : public binary_function<const _Tp*, _Ap, _Sp>
113 _Sp (_Tp::*__p_)(_Ap) const;
114 public:
115 _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_t(_Sp (_Tp::*__p)(_Ap) const)
116 : __p_(__p) {}
117 _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p, _Ap __x) const
118 {return (__p->*__p_)(__x);}
121 template <class _Sp, class _Tp>
122 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
123 const_mem_fun_t<_Sp,_Tp>
124 mem_fun(_Sp (_Tp::*__f)() const)
125 {return const_mem_fun_t<_Sp,_Tp>(__f);}
127 template <class _Sp, class _Tp, class _Ap>
128 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
129 const_mem_fun1_t<_Sp,_Tp,_Ap>
130 mem_fun(_Sp (_Tp::*__f)(_Ap) const)
131 {return const_mem_fun1_t<_Sp,_Tp,_Ap>(__f);}
133 template <class _Sp, class _Tp>
134 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun_ref_t
135 : public unary_function<_Tp, _Sp>
137 _Sp (_Tp::*__p_)() const;
138 public:
139 _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_ref_t(_Sp (_Tp::*__p)() const)
140 : __p_(__p) {}
141 _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p) const
142 {return (__p.*__p_)();}
145 template <class _Sp, class _Tp, class _Ap>
146 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 const_mem_fun1_ref_t
147 : public binary_function<_Tp, _Ap, _Sp>
149 _Sp (_Tp::*__p_)(_Ap) const;
150 public:
151 _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap) const)
152 : __p_(__p) {}
153 _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp& __p, _Ap __x) const
154 {return (__p.*__p_)(__x);}
157 template <class _Sp, class _Tp>
158 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
159 const_mem_fun_ref_t<_Sp,_Tp>
160 mem_fun_ref(_Sp (_Tp::*__f)() const)
161 {return const_mem_fun_ref_t<_Sp,_Tp>(__f);}
163 template <class _Sp, class _Tp, class _Ap>
164 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
165 const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
166 mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
167 {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
169 #endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
171 _LIBCPP_END_NAMESPACE_STD
173 #endif // _LIBCPP___FUNCTIONAL_MEM_FUN_REF_H