Trial.trying

A factory method to create Trial(T) instance.

interface Trial(T)
static nothrow
trying
(
T function
()
expr
)

Parameters

expr T function
()

a function block to return T value, and it may also raise exception.

Return Value

Type: Trial!T

A Success!T instance if (D_PARAM expr) is evaluated successfully, a Failure!T instance if (D_PARAM expr) raises an exception(not an error), otherwise raise an error.

Meta