match

Calls an appropriate handler depending on if the optional has a value or not

If either handler returns void, the return type of match is void.

template match(handlers...)
match
(
O
)
(
auto ref O opt
)
if (
handlers.length == 2
)

Members

Functions

match
auto match(O opt)
Undocumented in source. Be warned that the author may not have intended to support it.

Parameters

opt

The optional to call match on

handlers

2 predicates, one that takes the underlying optional type and another that names nothing

Meta