xtd 0.2.0
Loading...
Searching...
No Matches

◆ remove()

template<typename result_t , typename... arguments_t>
static delegate xtd::delegate< result_t(arguments_t...)>::remove ( const delegate< result_t(arguments_t...)> &  source,
const delegate< result_t(arguments_t...)> &  value 
)
inlinestaticnoexcept

removes the last occurrence of the invocation list of a delegate from the invocation list of another delegate.

Parameters
sourceThe delegate from which to remove the invocation list of value.
valueThe delegate that supplies the invocation list to remove from the invocation list of source.
Returns
delegate A new delegate with an invocation list formed by taking the invocation list of source and removing the last occurrence of the invocation list of value, if the invocation list of value is found within the invocation list of source. Returns source if value is null || if the invocation list of value is ! found within the invocation list of source. Returns a null reference if the invocation list of value is equal to the invocation list of source || if source is a null reference.
Remarks
If the invocation list of value matches a contiguous set of elements in the invocation list of source, then the invocation list of value is said to occur within the invocation list of source. If the invocation list of value occurs more than once in the invocation list of source, the last occurrence is removed.