// lib/prec_stl/functional #pragma ifndef PREC_STL_FUNCTIONAL #pragma define PREC_STL_FUNCTIONAL #pragma link off global PREC_STL_FUNCTIONAL; #pragma link C++ nestedtypedef; #pragma link C++ nestedclass; // Implemented by Scott Snyder, Fermi-lab // clause _lib.base_, base: template struct unary_function { typedef Arg argument_type; typedef Result result_type; }; template struct binary_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Result result_type; }; // clause _lib.arithmetic.operations_, arithmetic operations: template struct plus : binary_function { T operator()(const T& x, const T& y) const; }; template struct minus : binary_function { T operator()(const T& x, const T& y) const; }; template struct multiplies : binary_function { T operator()(const T& x, const T& y) const; }; template struct divides : binary_function { T operator()(const T& x, const T& y) const; }; template struct modulus : binary_function { T operator()(const T& x, const T& y) const; }; template struct negate : unary_function { T operator()(const T& x) const; }; // clause _lib.comparisons_, comparisons: template struct equal_to : binary_function { bool operator()(const T& x, const T& y) const; }; template struct not_equal_to : binary_function { bool operator()(const T& x, const T& y) const; }; template struct greater : binary_function { bool operator()(const T& x, const T& y) const; }; template struct less : binary_function { bool operator()(const T& x, const T& y) const; }; template struct greater_equal : binary_function { bool operator()(const T& x, const T& y) const; }; template struct less_equal : binary_function { bool operator()(const T& x, const T& y) const; }; // clause _lib.logical.operations_, logical operations: template struct logical_and : binary_function { bool operator()(const T& x, const T& y) const; }; template struct logical_or : binary_function { bool operator()(const T& x, const T& y) const; }; template struct logical_not : unary_function { bool operator()(const T& x) const; }; // clause _lib.negators_, negators: template class unary_negate : public unary_function { public: explicit unary_negate(const Predicate& pred); bool operator()(const argument_type& x) const; }; #if 0 template unary_negate not1(const Predicate& pred); #endif template class binary_negate : public binary_function { public: explicit binary_negate(const Predicate& pred); bool operator()(const first_argument_type& x, const second_argument_type& y) const; }; // operations omitted (cint can't handle template forward decls...) #if 0 template binary_negate not2(const Predicate& pred); #endif // clause _lib.binders_, binders: template class binder1st : public unary_function { protected: Operation op; Operation::first_argument_type value; public: binder1st(const Operation& x, const Operation::first_argument_type& y); result_type operator()(const argument_type& x) const; }; // operations omitted (cint can't handle template forward decls...) #if 0 template binder1st bind1st(const Operation&, const T&); #endif template class binder2nd : public unary_function { protected: Operation op; Operation::second_argument_type value; public: binder2nd(const Operation& x, const Operation::second_argument_type& y); result_type operator()(const argument_type& x) const; }; // operations omitted (cint can't handle template forward decls...) #if 0 template binder2nd bind2nd(const Operation&, const T&); #endif // clause _lib.function.pointer.adaptors_, adaptors: template class pointer_to_unary_function : public unary_function { public: explicit pointer_to_unary_function(Result (*f)(Arg)); Result operator()(Arg x) const; }; // operations omitted (cint can't handle template forward decls...) #if 0 template pointer_to_unary_function ptr_fun(Result (*)(Arg)); #endif template class pointer_to_binary_function : public binary_function { public: explicit pointer_to_binary_function(Result (*f)(Arg1, Arg2)); Result operator()(Arg1 x, Arg2 y) const; }; // operations omitted (cint can't handle template forward decls...) #if 0 template pointer_to_binary_function ptr_fun(Result (*)(Arg1,Arg2)); #endif // omit these for now. #if 0 // clause _lib.member.pointer.adaptors_, adaptors: template class mem_fun_t; template class mem_fun1_t; template mem_fun_t mem_fun(S (T::*f)()); template mem_fun1_t mem_fun1(S (T::*f)(A)); template class mem_fun_ref_t; template class mem_fun1_ref_t; template mem_fun_ref_t mem_fun_ref(S (T::*f)()); template mem_fun1_ref_t mem_fun1_ref(S (T::*f)(A)); #endif #pragma endif