Base module

AbstractDelegate

Abstract delegate interface.

AbstractDelegate

#include <icy/delegate.h>

Abstract delegate interface.

The Delegate class contains a pointer to a function. This wrapper class is used instead of std::function since it is interchangable with fast delegates and also provides an equality operator for comparing the underlying function where supported.

Public Methods

ReturnNameDescription
RToperator() constInvokes the underlying callable with the supplied arguments.
booloperator== constCompares two delegates for equality (same target function and instance).

operator()

const

RT operator()(Args... args) const

Invokes the underlying callable with the supplied arguments.

Parameters

  • args Arguments forwarded to the wrapped function.

Returns

Result of the wrapped function call.


operator==

const

bool operator==(const AbstractDelegate< RT, Args... > & that) const

Compares two delegates for equality (same target function and instance).

Parameters

  • that Other delegate to compare against.

Returns

True if both delegates refer to the same callable target.