utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 > Struct Template Reference

Binary functor composition with two unary functors. More...

#include <binary_compose.hh>

List of all members.

Public Member Functions

 binary_compose_2 (BinaryFun const &bin, UnaryFun1 const &one, UnaryFun2 const &two)
 Constructor.
 binary_compose_2 (BinaryFun const &bin, UnaryFun1 const &one, UnaryFun2 const &two)
 Constructor.
BinaryFun::result_type operator() (first_arg a, second_arg b) const
 Call operator.
BinaryFun::result_type operator() (first_arg a, second_arg b) const
 Call operator.

Private Types

typedef arg_traits< typename
UnaryFun1::argument_type >
::type 
first_arg
typedef arg_traits< typename
UnaryFun1::argument_type >
::type 
first_arg
typedef arg_traits< typename
UnaryFun2::argument_type >
::type 
second_arg
typedef arg_traits< typename
UnaryFun2::argument_type >
::type 
second_arg

Private Attributes

BinaryFun bin_fn
UnaryFun1 fun_1
UnaryFun2 fun_2

Related Functions

(Note that these are not member functions.)



template<class Bin , class Fun1 , class Fun2 >
binary_compose_2< Bin, Fun1, Fun2 > compose2_2 (Bin const &f, Fun1 const &a, Fun2 const &b)
 Composition function.

Detailed Description

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
struct utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >

Binary functor composition with two unary functors.

This class helps programmers to compose one std::binary_function with two std::unary_function

Parameters:
BinaryFun The binary functor
UnaryFun1 The first unary function
UnaryFun2 The second unary function

The resulting class is a functor corresponding to BinaryFun(UnaryFun1(x), UnaryFun2(y))

Precondition:
The result_type of UnaryFun1 must be default convertible to the first_argument_type of BinaryFun
The result_type of UnaryFun2 must be default convertible to the second_argument_type of BinaryFun
Author:
Frédéric Py <fpy@laas.fr>
See also:
utilmm::unary_compose

Definition at line 34 of file install/include/utilmm/functional/binary_compose.hh.


Member Typedef Documentation

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
typedef arg_traits<typename UnaryFun1::argument_type>::type utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::first_arg [private]

Definition at line 45 of file utilmm/functional/binary_compose.hh.

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
typedef arg_traits<typename UnaryFun1::argument_type>::type utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::first_arg [private]
template<class BinaryFun, class UnaryFun1, class UnaryFun2>
typedef arg_traits<typename UnaryFun2::argument_type>::type utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::second_arg [private]

Definition at line 47 of file utilmm/functional/binary_compose.hh.

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
typedef arg_traits<typename UnaryFun2::argument_type>::type utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::second_arg [private]

Constructor & Destructor Documentation

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::binary_compose_2 ( BinaryFun const &  bin,
UnaryFun1 const &  one,
UnaryFun2 const &  two 
) [inline]

Constructor.

Create a new instance having the three functors instances to compose.

Parameters:
bin The binary functor
one The first unary functor
two The second unary functor
Postcondition:
newly created instance will have exactly the same behavior as bin(one(x), two(y)).
See also:
utilmm::compose2_2

Definition at line 36 of file install/include/utilmm/functional/binary_compose.hh.

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::binary_compose_2 ( BinaryFun const &  bin,
UnaryFun1 const &  one,
UnaryFun2 const &  two 
) [inline]

Constructor.

Create a new instance having the three functors instances to compose.

Parameters:
bin The binary functor
one The first unary functor
two The second unary functor
Postcondition:
newly created instance will have exactly the same behavior as bin(one(x), two(y)).
See also:
utilmm::compose2_2

Definition at line 64 of file utilmm/functional/binary_compose.hh.


Member Function Documentation

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
BinaryFun::result_type utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::operator() ( first_arg  a,
second_arg  b 
) const [inline]

Call operator.

Compute the result of the composition for given arguments

Parameters:
a The first argument
b The second argument
Returns:
The result of the operation

Definition at line 77 of file utilmm/functional/binary_compose.hh.

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
BinaryFun::result_type utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::operator() ( first_arg  a,
second_arg  b 
) const [inline]

Call operator.

Compute the result of the composition for given arguments

Parameters:
a The first argument
b The second argument
Returns:
The result of the operation

Definition at line 49 of file install/include/utilmm/functional/binary_compose.hh.


Friends And Related Function Documentation

template<class Bin , class Fun1 , class Fun2 >
binary_compose_2< Bin, Fun1, Fun2 > compose2_2 ( Bin const &  f,
Fun1 const &  a,
Fun2 const &  b 
) [related]

Composition function.

This function create a new binary_compose_2 based on one binary_function and two unary functions. It only ease the declaration of binary_compose_2 instances.

Parameters:
f The binary function
a The first unary function
b The second unary function
Returns:
a functor corresponding to f(a(x), b(y))
See also:
binary_compose_2::binary_compose_2

Definition at line 100 of file install/include/utilmm/functional/binary_compose.hh.


Member Data Documentation

template<class BinaryFun, class UnaryFun1, class UnaryFun2>
BinaryFun utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::bin_fn [private]
template<class BinaryFun, class UnaryFun1, class UnaryFun2>
UnaryFun1 utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::fun_1 [private]
template<class BinaryFun, class UnaryFun1, class UnaryFun2>
UnaryFun2 utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >::fun_2 [private]

The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


utilmm
Author(s): Sylvain Joyeux/sylvain.joyeux@m4x.org
autogenerated on Fri Jan 11 10:07:42 2013