Intel® Cilk™ Plus Include Directory
Revision 4358

Indirect binary function class with specified types. More...
Public Member Functions  
typed_indirect_binary_function (const F *f)  
Constructor captures a pointer to the wrapped function.  
const F *  pointer () const 
Return the comparator pointer, or NULL if the comparator is stateless.  
R  operator() (const A1 &a1, const A2 &a2) const 
Apply the pointedto functor to the arguments.  
Indirect binary function class with specified types.
typed_indirect_binary_function<F>
is an Adaptable Binary Function
class based on an existing binary functor class or binary function type F. If F is a stateless class, then this class will be empty, and its operator()
will invoke F's operator()
. Otherwise, an object of this class will hold a pointer to an object of type F, and will refer its operator()
calls to the pointedto F object.
That is, suppose that we have the declarations:
F *p; typed_indirect_binary_function<F, int, int, bool> ibf(p);
Then:
ibf(x, y) == (*p)(x, y)
.ibf(x, y)
will not do a pointer dereference if F
is an empty class.F
is an empty class, then `typed_indirect_binary_function<F>' is also an empty class. This is critical for its use in the min/max reducer view classes, where it allows the view to call a comparison functor in the monoid without actually having to allocate a pointer in the view class when the comparison class is empty.Adaptable Binary Function
class or a binary function type, then you can use the indirect_binary_function class, which derives the argument and result types parameter type instead of requiring you to specify them as template arguments.F  A binary functor class, a binary function type, or a pointer to binary function type. 
A1  The first argument type. 
A2  The second argument type. 
R  The result type. 