Util--  1.1
Public Member Functions | Related Functions | List of all members
utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 > Struct Template Reference

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

#include <utilmm/functional/binary_compose.hh>

Inheritance diagram for utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >:
Inheritance graph
[legend]
Collaboration diagram for utilmm::binary_compose_2< BinaryFun, UnaryFun1, UnaryFun2 >:
Collaboration graph
[legend]

Public Member Functions

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

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. More...
 

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
BinaryFunThe binary functor
UnaryFun1The first unary function
UnaryFun2The 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@l.nosp@m.aas..nosp@m.fr
See also
utilmm::unary_compose

Constructor & Destructor Documentation

◆ binary_compose_2()

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
binThe binary functor
oneThe first unary functor
twoThe second unary functor
Postcondition
newly created instance will have exactly the same behavior as bin(one(x), two(y)).
See also
utilmm::compose2_2

Member Function Documentation

◆ operator()()

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
aThe first argument
bThe second argument
Returns
The result of the operation

Friends And Related Function Documentation

◆ compose2_2()

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
fThe binary function
aThe first unary function
bThe second unary function
Returns
a functor corresponding to f(a(x), b(y))
See also
binary_compose_2::binary_compose_2

The documentation for this struct was generated from the following file:

Generated on Wed Oct 17 2018 09:34:19 for Util-- by doxygen 1.8.13
SourceForge.net Project Page