Home -> SuccessToken -> Constructor

Description

The SuccessToken constructor creates a token representing the result of an operation that may fail. Renderer API methods return this type when the application is expected to observe success or failure rather than assuming the operation completed.

In debug builds, a token whose result is never inspected can raise an assertion. This is deliberate: many renderer setup and resource allocation failures are recoverable only if the application checks the returned token and reacts appropriately.

ImportantImportant

Use IgnoreResult only when failure has intentionally been accepted and no response is required.

Usage

SuccessToken(bool success);
SuccessToken(SuccessToken&& source);
SuccessToken(const SuccessToken& source);

Argument list

success [bool]
True if the operation succeeded, false otherwise.
source [SuccessToken&&]
The source token to move from. The source token is marked as observed.
source [const SuccessToken&]
The source token to copy from. The source token is marked as observed.

See also