boxed

Constructor function to create a shared Boxed with an unqualified template type.

shared(Sendable)
boxed
(
T
)

Parameters

payload T

Payload whose type to instantiate the Boxed with, and then assign to its internal payload.

Return Value

Type: shared(Sendable)

A shared Boxed!T where T` is the unqualified type of the payload.

Examples

IRCEvent event;  // ...
mainThread.send(ThreadMessage.busMessage("header", boxed(event)));
mainThread.send(ThreadMessage.busMessage("other header", boxed("text payload")));
mainThread.send(ThreadMessage.busMessage("ladida", boxed(42)));

Meta