Functions
Functor Object Accessors

Functions

template<typename Arg , typename Result >
pointer_to_unary_function< Arg, Result > ustl::ptr_fun (Result(*pfn)(Arg))
 
template<typename Arg1 , typename Arg2 , typename Result >
pointer_to_binary_function< Arg1, Arg2, Result > ustl::ptr_fun (Result(*pfn)(Arg1, Arg2))
 
template<class UnaryFunction >
unary_negate< UnaryFunction > ustl::unary_negator (UnaryFunction pfn)
 
template<typename BinaryFunction >
binder1st< BinaryFunction > ustl::bind1st (BinaryFunction pfn, typename BinaryFunction::first_argument_type v)
 
template<typename BinaryFunction >
binder2nd< BinaryFunction > ustl::bind2nd (BinaryFunction pfn, typename BinaryFunction::second_argument_type v)
 
template<typename Operation1 , typename Operation2 >
unary_compose< Operation1, Operation2 > ustl::compose1 (const Operation1 &f, const Operation2 &g)
 
template<typename Operation1 , typename Operation2 , typename Operation3 >
binary_compose< Operation1, Operation2, Operation3 > ustl::compose2 (const Operation1 &f, const Operation2 &g, const Operation3 &h)
 
template<class T , typename VT >
const_mem_var1_t< binder2nd< equal_to< VT > >, T, VT > ustl::mem_var_equal_to (const VT T::*mvp, const VT &v)
 
template<class T , typename VT >
const_mem_var1_t< binder2nd< less< VT > >, T, VT > ustl::mem_var_less (const VT T::*mvp, const VT &v)
 
template<class T , typename VT >
const_mem_var2_t< equal_to< VT >, T, VT > ustl::mem_var_equal_to (const VT T::*mvp)
 
template<class T , typename VT >
const_mem_var2_t< less< VT >, T, VT > ustl::mem_var_less (const VT T::*mvp)
 

Detailed Description

Because C++ is so very unsuited to functional programming, trying to do so may require a lot of typing. These accessor functions are somewhat helpful in making functional constructs more readable.

Function Documentation

template<typename BinaryFunction >
binder1st<BinaryFunction> ustl::bind1st ( BinaryFunction  pfn,
typename BinaryFunction::first_argument_type  v 
)
inline

Converts pfn into a unary function by binding the first argument to v.

template<typename BinaryFunction >
binder2nd<BinaryFunction> ustl::bind2nd ( BinaryFunction  pfn,
typename BinaryFunction::second_argument_type  v 
)
inline

Converts pfn into a unary function by binding the second argument to v.

Referenced by ustl::mem_var_equal_to(), and ustl::mem_var_less().

template<typename Operation1 , typename Operation2 >
unary_compose<Operation1, Operation2> ustl::compose1 ( const Operation1 &  f,
const Operation2 &  g 
)
inline

Creates a unary_compose object whose function c(x)=f(g(x))

template<typename Operation1 , typename Operation2 , typename Operation3 >
binary_compose<Operation1, Operation2, Operation3> ustl::compose2 ( const Operation1 &  f,
const Operation2 &  g,
const Operation3 &  h 
)
inline

Creates a binary_compose object whose function c(x)=f(g(x),h(x))

template<class T , typename VT >
const_mem_var1_t<binder2nd<equal_to<VT> >, T, VT> ustl::mem_var_equal_to ( const VT T::*  mvp,
const VT &  v 
)
inline

Returned functor passes member variable mvp reference of given object to equal<VT>.

References ustl::bind2nd().

template<class T , typename VT >
const_mem_var2_t<equal_to<VT>, T, VT> ustl::mem_var_equal_to ( const VT T::*  mvp)
inline

Returned functor passes member variable mvp reference of given object to equal<VT>.

template<class T , typename VT >
const_mem_var1_t<binder2nd<less<VT> >, T, VT> ustl::mem_var_less ( const VT T::*  mvp,
const VT &  v 
)
inline

Returned functor passes member variable mvp reference of given object to less<VT>.

References ustl::bind2nd().

template<class T , typename VT >
const_mem_var2_t<less<VT>, T, VT> ustl::mem_var_less ( const VT T::*  mvp)
inline

Returned functor passes member variable mvp reference of given object to less<VT>.

template<typename Arg , typename Result >
pointer_to_unary_function<Arg,Result> ustl::ptr_fun ( Result(*)(Arg)  pfn)
inline

ptr_fun(pfn) wraps function pointer pfn into a functor class that calls it.

template<typename Arg1 , typename Arg2 , typename Result >
pointer_to_binary_function<Arg1,Arg2,Result> ustl::ptr_fun ( Result(*)(Arg1, Arg2)  pfn)
inline

ptr_fun(pfn) wraps function pointer pfn into a functor class that calls it.

template<class UnaryFunction >
unary_negate<UnaryFunction> ustl::unary_negator ( UnaryFunction  pfn)
inline

Returns the functor that negates the result of *pfn().


Generated on Mon Sep 28 2015 17:58:50 for uSTL by Doxygen 1.8.10