File indexing completed on 2026-05-03 08:13:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef _LIBCPP___CXX03___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
0011 #define _LIBCPP___CXX03___FUNCTIONAL_POINTER_TO_UNARY_FUNCTION_H
0012
0013 #include <__cxx03/__config>
0014 #include <__cxx03/__functional/unary_function.h>
0015
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 # pragma GCC system_header
0018 #endif
0019
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021
0022 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
0023
0024 template <class _Arg, class _Result>
0025 class _LIBCPP_TEMPLATE_VIS
0026 _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_unary_function : public __unary_function<_Arg, _Result> {
0027 _Result (*__f_)(_Arg);
0028
0029 public:
0030 _LIBCPP_HIDE_FROM_ABI explicit pointer_to_unary_function(_Result (*__f)(_Arg)) : __f_(__f) {}
0031 _LIBCPP_HIDE_FROM_ABI _Result operator()(_Arg __x) const { return __f_(__x); }
0032 };
0033
0034 template <class _Arg, class _Result>
0035 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_HIDE_FROM_ABI pointer_to_unary_function<_Arg, _Result>
0036 ptr_fun(_Result (*__f)(_Arg)) {
0037 return pointer_to_unary_function<_Arg, _Result>(__f);
0038 }
0039
0040 #endif
0041
0042 _LIBCPP_END_NAMESPACE_STD
0043
0044 #endif