Path: blob/main/contrib/llvm-project/libcxx/include/__functional/unary_function.h
35259 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H9#define _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H1011#include <__config>1213#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)14# pragma GCC system_header15#endif1617_LIBCPP_BEGIN_NAMESPACE_STD1819#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)2021template <class _Arg, class _Result>22struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 unary_function {23typedef _Arg argument_type;24typedef _Result result_type;25};2627#endif // _LIBCPP_STD_VER <= 142829template <class _Arg, class _Result>30struct __unary_function_keep_layout_base {31#if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS)32using argument_type _LIBCPP_DEPRECATED_IN_CXX17 = _Arg;33using result_type _LIBCPP_DEPRECATED_IN_CXX17 = _Result;34#endif35};3637#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)38_LIBCPP_DIAGNOSTIC_PUSH39_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdeprecated-declarations")40template <class _Arg, class _Result>41using __unary_function = unary_function<_Arg, _Result>;42_LIBCPP_DIAGNOSTIC_POP43#else44template <class _Arg, class _Result>45using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;46#endif4748_LIBCPP_END_NAMESPACE_STD4950#endif // _LIBCPP___FUNCTIONAL_UNARY_FUNCTION_H515253