Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:51

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___FUNCTIONAL_BINDER2ND_H
0011 #define _LIBCPP___FUNCTIONAL_BINDER2ND_H
0012 
0013 #include <__config>
0014 #include <__functional/unary_function.h>
0015 
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 #  pragma GCC system_header
0018 #endif
0019 
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021 
0022 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
0023 
0024 template <class _Operation>
0025 class _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX11 binder2nd
0026     : public __unary_function<typename _Operation::first_argument_type, typename _Operation::result_type> {
0027 protected:
0028   _Operation op;
0029   typename _Operation::second_argument_type value;
0030 
0031 public:
0032   _LIBCPP_HIDE_FROM_ABI binder2nd(const _Operation& __x, const typename _Operation::second_argument_type __y)
0033       : op(__x), value(__y) {}
0034   _LIBCPP_HIDE_FROM_ABI typename _Operation::result_type
0035   operator()(typename _Operation::first_argument_type& __x) const {
0036     return op(__x, value);
0037   }
0038   _LIBCPP_HIDE_FROM_ABI typename _Operation::result_type
0039   operator()(const typename _Operation::first_argument_type& __x) const {
0040     return op(__x, value);
0041   }
0042 };
0043 
0044 template <class _Operation, class _Tp>
0045 _LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_HIDE_FROM_ABI binder2nd<_Operation>
0046 bind2nd(const _Operation& __op, const _Tp& __x) {
0047   return binder2nd<_Operation>(__op, __x);
0048 }
0049 
0050 #endif // _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
0051 
0052 _LIBCPP_END_NAMESPACE_STD
0053 
0054 #endif // _LIBCPP___FUNCTIONAL_BINDER2ND_H