Thunk.force

T force()()

Evaluate the recipe at most once and return its retained outcome.

The recipe and initial cache construction complete before returning a payload copy. Copying a successful payload can itself throw or allocate; that does not change the recipe's already successful outcome. Attributes are inferred from the payload operations; no purity, nothrow or @nogc guarantee is made. There is no reference return or implicit conversion.

Returns

A copy of the cached value, or nothing for Thunk!void.

Throws

InvalidThunkException for an empty handle;

ThunkCycleError on recursive forcing; ThunkAbortedError after an abnormal evaluation unwind; the original cached exception on recipe/cache-construction failure; uncaught fatal throwables or failures copying a successful payload.