Intel® Cilk™ Plus Include Directory  Revision 4358
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
cilk::internal::typed_indirect_binary_function< F, A1, A2, R, Functor, FunctorIsEmpty > Class Template Reference

Indirect binary function class with specified types. More...

Inheritance diagram for cilk::internal::typed_indirect_binary_function< F, A1, A2, R, Functor, FunctorIsEmpty >:

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.
 
operator() (const A1 &a1, const A2 &a2) const
 Apply the pointed-to functor to the arguments.
 

Detailed Description

template<typename F, typename A1, typename A2, typename R, typename Functor = typename binary_functor<F>::type, bool FunctorIsEmpty = class_is_empty<Functor>::value>
class cilk::internal::typed_indirect_binary_function< F, A1, A2, R, Functor, FunctorIsEmpty >

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 pointed-to F object.

That is, suppose that we have the declarations:

F *p;
typed_indirect_binary_function<F, int, int, bool> ibf(p);

Then:

Note
Just to repeat: if 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.
If you have an 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.
Template Parameters
FA binary functor class, a binary function type, or a pointer to binary function type.
Parameters
A1The first argument type.
A2The second argument type.
RThe result type.
See Also
min_max::comparator_base
indirect_binary_function

The documentation for this class was generated from the following file:
© 2015 Intel Corporation. All rights reserved. | Intel and Cilk are trademarks of Intel Corporation in the U.S. and/or other countries