multicast_delegate

Implements a C#-style multicast delegate which is simply a collection of delegates acting like one single delegate.

All functionality is in the type MulticastImpl with a helper construction function called multicast.

Use Multicast for an API which asserts out if you attempt to call uninitialized Multicast values or MulticastOpt for an API which simply does nothing when called with uninitialized values.

Members

Aliases

Multicast
alias Multicast(Del) = MulticastImpl!(Del, true)

MulticastDelegate API which asserts out if you attempt to call it with an empty list.

MulticastOpt
alias MulticastOpt(Del) = MulticastImpl!(Del, false)

MulticastDelegate API which simply does nothing if you attempt to call it with an empty list. Returns the init value and performs no out/ref modifications.

Functions

multicast
Multicast!Del multicast(Del[] delegates)

Constructs a multicast delegate from a variadic list of delegates.

Structs

MulticastImpl
struct MulticastImpl(Del, bool assertIfNull)

Full multicast delegate implementation of this package. Modification operations are nothrow, pure, @safe and if possible @nogc. Using the @nogc overloads it's possible to use all functionality. Invocation inherits the attributes of the delegate or function pointer.

Meta

Authors

webfreak

License

released in the public domain under the unlicense, see LICENSE