1128765Spjd// -*- C++ -*- 2128765Spjd//===----------------------------------------------------------------------===// 3128765Spjd// 4128765Spjd// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5128765Spjd// See https://llvm.org/LICENSE.txt for license information. 6128765Spjd// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7128765Spjd// 8128765Spjd//===----------------------------------------------------------------------===// 9128765Spjd 10128765Spjd#ifndef _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H 11128765Spjd#define _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H 12128765Spjd 13128765Spjd#include <__config> 14128765Spjd 15128765Spjd#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 16128765Spjd# pragma GCC system_header 17128765Spjd#endif 18128765Spjd 19128765Spjd_LIBCPP_BEGIN_NAMESPACE_STD 20128765Spjd 21128765Spjd#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) 22128765Spjd 23128765Spjdtemplate <class _Arg1, class _Arg2, class _Result> 24128765Spjdstruct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binary_function 25128765Spjd{ 26128765Spjd typedef _Arg1 first_argument_type; 27128765Spjd typedef _Arg2 second_argument_type; 28128765Spjd typedef _Result result_type; 29128765Spjd}; 30128765Spjd 31128765Spjd#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) 32128765Spjd 33128765Spjdtemplate <class _Arg1, class _Arg2, class _Result> struct __binary_function_keep_layout_base { 34128765Spjd#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS) 35128765Spjd using first_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg1; 36128765Spjd using second_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg2; 37147844Spjd using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result; 38147844Spjd#endif 39128765Spjd}; 40128765Spjd 41147844Spjd#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION) 42147844Spjd_LIBCPP_DIAGNOSTIC_PUSH 43128765Spjd_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations") 44128765Spjdtemplate <class _Arg1, class _Arg2, class _Result> 45128765Spjdusing __binary_function = binary_function<_Arg1, _Arg2, _Result>; 46128765Spjd_LIBCPP_DIAGNOSTIC_POP 47128765Spjd#else 48128765Spjdtemplate <class _Arg1, class _Arg2, class _Result> 49128765Spjdusing __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>; 50128765Spjd#endif 51128765Spjd 52128765Spjd_LIBCPP_END_NAMESPACE_STD 53128765Spjd 54128765Spjd#endif // _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H 55128765Spjd