Path: blob/main/contrib/llvm-project/libcxx/include/__functional/binary_function.h
35260 views
// -*- C++ -*-1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//89#ifndef _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H10#define _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H1112#include <__config>1314#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)15# pragma GCC system_header16#endif1718_LIBCPP_BEGIN_NAMESPACE_STD1920#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)2122template <class _Arg1, class _Arg2, class _Result>23struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binary_function {24typedef _Arg1 first_argument_type;25typedef _Arg2 second_argument_type;26typedef _Result result_type;27};2829#endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)3031template <class _Arg1, class _Arg2, class _Result>32struct __binary_function_keep_layout_base {33#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)34using first_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg1;35using second_argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg2;36using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result;37#endif38};3940#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)41_LIBCPP_DIAGNOSTIC_PUSH42_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")43template <class _Arg1, class _Arg2, class _Result>44using __binary_function = binary_function<_Arg1, _Arg2, _Result>;45_LIBCPP_DIAGNOSTIC_POP46#else47template <class _Arg1, class _Arg2, class _Result>48using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>;49#endif5051_LIBCPP_END_NAMESPACE_STD5253#endif // _LIBCPP___FUNCTIONAL_BINARY_FUNCTION_H545556