Instigate Open Source Documentation

instigate::stl::ternary_function Namespace Reference

Ternary Function Concept. More...


struct  interface
 Interface of the Ternary Function concept. More...
struct  interface< R(*)(A, B, C)>
 Making plain C function with 3 arguments a model of concept. More...
struct  interface< R(A::*)(B, C)>
 Making a binary method of a class a model of concept. More...
struct  interface< R(A::*)(B, C) const >
 Making a const binary method of a class a model of concept Ternary Function. More...
struct  requirements
 Requirements of the instigate::stl::ternary_function. More...

Detailed Description

Ternary Function Concept.

ternary_function is a correspondence between triangle of argument values and a result value. I.e. for each triangle of argument values it should be possible to invoke the function and obtain the corresponding result value.

ternary_functions in instigate::stl are adaptable, including plain C functions.

It is under user's responsibility, to define associated types (i.e. first_argument_type, second_argument_type, third_argument_type and result_type) in such way, that temporary objects will not be created by the compiler upon passing arguments and returning value, e.g. arguments can be passed by reference or const reference.
This is a "non-intrusive" interface of the ternary_function, which does not impose any syntactical constraints on the Model. E.g. we do not require it to redefine operator(). Any type that conceptually can be treated as a ternary function can become a model of this concept, if this interface is provided for it by specializing this template structure with that type and providing definitions for associated types and basic operations.

© Instigate CJSC, Open Source