1*050b064fSChristopher Di Bella // -*- C++ -*-
2*050b064fSChristopher Di Bella //===----------------------------------------------------------------------===//
3*050b064fSChristopher Di Bella //
4*050b064fSChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5*050b064fSChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
6*050b064fSChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7*050b064fSChristopher Di Bella //
8*050b064fSChristopher Di Bella //===----------------------------------------------------------------------===//
9*050b064fSChristopher Di Bella 
10*050b064fSChristopher Di Bella #ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
11*050b064fSChristopher Di Bella #define _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
12*050b064fSChristopher Di Bella 
13*050b064fSChristopher Di Bella #include <__config>
14*050b064fSChristopher Di Bella #include <__functional/binary_function.h>
15*050b064fSChristopher Di Bella 
16*050b064fSChristopher Di Bella #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17*050b064fSChristopher Di Bella #pragma GCC system_header
18*050b064fSChristopher Di Bella #endif
19*050b064fSChristopher Di Bella 
20*050b064fSChristopher Di Bella _LIBCPP_BEGIN_NAMESPACE_STD
21*050b064fSChristopher Di Bella 
22*050b064fSChristopher Di Bella #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
23*050b064fSChristopher Di Bella 
24*050b064fSChristopher Di Bella template <class _Arg1, class _Arg2, class _Result>
25*050b064fSChristopher Di Bella class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function
26*050b064fSChristopher Di Bella     : public binary_function<_Arg1, _Arg2, _Result>
27*050b064fSChristopher Di Bella {
28*050b064fSChristopher Di Bella     _Result (*__f_)(_Arg1, _Arg2);
29*050b064fSChristopher Di Bella public:
30*050b064fSChristopher Di Bella     _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
31*050b064fSChristopher Di Bella         : __f_(__f) {}
32*050b064fSChristopher Di Bella     _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
33*050b064fSChristopher Di Bella         {return __f_(__x, __y);}
34*050b064fSChristopher Di Bella };
35*050b064fSChristopher Di Bella 
36*050b064fSChristopher Di Bella template <class _Arg1, class _Arg2, class _Result>
37*050b064fSChristopher Di Bella _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
38*050b064fSChristopher Di Bella pointer_to_binary_function<_Arg1,_Arg2,_Result>
39*050b064fSChristopher Di Bella ptr_fun(_Result (*__f)(_Arg1,_Arg2))
40*050b064fSChristopher Di Bella     {return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
41*050b064fSChristopher Di Bella 
42*050b064fSChristopher Di Bella #endif
43*050b064fSChristopher Di Bella 
44*050b064fSChristopher Di Bella _LIBCPP_END_NAMESPACE_STD
45*050b064fSChristopher Di Bella 
46*050b064fSChristopher Di Bella #endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
47