1050b064fSChristopher Di Bella // -*- C++ -*-
2050b064fSChristopher Di Bella //===----------------------------------------------------------------------===//
3050b064fSChristopher Di Bella //
4050b064fSChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5050b064fSChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
6050b064fSChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7050b064fSChristopher Di Bella //
8050b064fSChristopher Di Bella //===----------------------------------------------------------------------===//
9050b064fSChristopher Di Bella
10050b064fSChristopher Di Bella #ifndef _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
11050b064fSChristopher Di Bella #define _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
12050b064fSChristopher Di Bella
13050b064fSChristopher Di Bella #include <__config>
14050b064fSChristopher Di Bella #include <__functional/binary_function.h>
15050b064fSChristopher Di Bella
16050b064fSChristopher Di Bella #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
17050b064fSChristopher Di Bella # pragma GCC system_header
18050b064fSChristopher Di Bella #endif
19050b064fSChristopher Di Bella
20050b064fSChristopher Di Bella _LIBCPP_BEGIN_NAMESPACE_STD
21050b064fSChristopher Di Bella
22050b064fSChristopher Di Bella #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
23050b064fSChristopher Di Bella
24050b064fSChristopher Di Bella template <class _Arg1, class _Arg2, class _Result>
25050b064fSChristopher Di Bella class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 pointer_to_binary_function
26*681cde7dSNikolas Klauser : public __binary_function<_Arg1, _Arg2, _Result>
27050b064fSChristopher Di Bella {
28050b064fSChristopher Di Bella _Result (*__f_)(_Arg1, _Arg2);
29050b064fSChristopher Di Bella public:
pointer_to_binary_function(_Result (* __f)(_Arg1,_Arg2))30050b064fSChristopher Di Bella _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
31050b064fSChristopher Di Bella : __f_(__f) {}
operator()32050b064fSChristopher Di Bella _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
33050b064fSChristopher Di Bella {return __f_(__x, __y);}
34050b064fSChristopher Di Bella };
35050b064fSChristopher Di Bella
36050b064fSChristopher Di Bella template <class _Arg1, class _Arg2, class _Result>
37050b064fSChristopher Di Bella _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
38050b064fSChristopher Di Bella pointer_to_binary_function<_Arg1,_Arg2,_Result>
ptr_fun(_Result (* __f)(_Arg1,_Arg2))39050b064fSChristopher Di Bella ptr_fun(_Result (*__f)(_Arg1,_Arg2))
40050b064fSChristopher Di Bella {return pointer_to_binary_function<_Arg1,_Arg2,_Result>(__f);}
41050b064fSChristopher Di Bella
42050b064fSChristopher Di Bella #endif
43050b064fSChristopher Di Bella
44050b064fSChristopher Di Bella _LIBCPP_END_NAMESPACE_STD
45050b064fSChristopher Di Bella
46050b064fSChristopher Di Bella #endif // _LIBCPP___FUNCTIONAL_POINTER_TO_BINARY_FUNCTION_H
47