+ /** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+ template<typename _Predicate, typename argument_type>
+ class __unary_negate
+ : public std::unary_function<argument_type, bool>
+ {
+ protected:
+ _Predicate _M_pred;
+
+ public:
+ explicit
+ __unary_negate(const _Predicate& __x) : _M_pred(__x) { }
+
+ bool
+ operator()(const argument_type& __x)
+ { return !_M_pred(__x); }
+ };
+
+ /** @brief Similar to std::binder1st,
+ * but giving the argument types explicitly. */
+ template<typename _Operation, typename _FirstArgumentType,
+ typename _SecondArgumentType, typename _ResultType>
+ class __binder1st
+ : public std::unary_function<_SecondArgumentType, _ResultType>
+ {
+ protected:
+ _Operation _M_op;
+ _FirstArgumentType _M_value;
+
+ public:
+ __binder1st(const _Operation& __x, const _FirstArgumentType& __y)
+ : _M_op(__x), _M_value(__y) { }
+
+ _ResultType
+ operator()(const _SecondArgumentType& __x)
+ { return _M_op(_M_value, __x); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ _ResultType
+ operator()(_SecondArgumentType& __x) const
+ { return _M_op(_M_value, __x); }
+ };
+
+ /**
+ * @brief Similar to std::binder2nd, but giving the argument types
+ * explicitly.
+ */
+ template<typename _Operation, typename _FirstArgumentType,
+ typename _SecondArgumentType, typename _ResultType>
+ class binder2nd
+ : public std::unary_function<_FirstArgumentType, _ResultType>
+ {
+ protected:
+ _Operation _M_op;
+ _SecondArgumentType _M_value;
+
+ public:
+ binder2nd(const _Operation& __x, const _SecondArgumentType& __y)
+ : _M_op(__x), _M_value(__y) { }
+
+ _ResultType
+ operator()(const _FirstArgumentType& __x) const
+ { return _M_op(__x, _M_value); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 109. Missing binders for non-const sequence elements
+ _ResultType
+ operator()(_FirstArgumentType& __x)
+ { return _M_op(__x, _M_value); }
+ };
+
+ /** @brief Similar to std::equal_to, but allows two different types. */
+ template<typename _T1, typename _T2>
+ struct _EqualTo : std::binary_function<_T1, _T2, bool>
+ {
+ bool operator()(const _T1& __t1, const _T2& __t2) const
+ { return __t1 == __t2; }
+ };