Template Class BoundNullaryMemberFunction

Inheritance Relationships

Base Type

Class Documentation

template<typename C, typename R = void>
class BoundNullaryMemberFunction : public ecl::NullaryFunction<void>

Nullary function object for bound nullary member functions.

Binds the class instance for a nullary member function and uses this to construct a nullary function object.

Usage:

class A {
public:
    void f() { //...
    }

int main() {
    A a;
    BoundNullaryMemberFunction<A,void> function_object(&A::f,a);
    function_object();
}

See also

ecl::utilities::BoundNullaryMemberFunction<C,void>, generateFunctionObject, FunctionObjects.

Template Parameters:
  • C – : the member function’s class type.

  • R – : the return type.

Public Functions

inline BoundNullaryMemberFunction(R (C::* function)(), C &class_object)

Binds a unary member function and creates a nullary function object.

Accepts the function pointer and class instance, binds them and creates a nullary function object.

Parameters:
  • function – : the void member function.

  • class_object – : the member function’s class instance.

inline virtual ~BoundNullaryMemberFunction()
inline virtual R operator()()

This ensures any children objects are deleted correctly.

A nullary function object call.

Redirects the nullary function object call to the bound member function.

Returns:

R : the function’s return value.