insightdock::charts::ChartResult

Result of a chart export operation — either a value or a ChartError.

Synopsis

Declared in <insightdock/error.h>
template<typename T>
struct ChartResult;

Member Functions

Name Description
error Error code; ChartError::None when ok.
operator bool Contextual bool conversion — true on success.

Static Member Functions

Name Description
failure Construct a failed result with error e.
success Construct a successful result holding v.

Data Members

Name Description
error_code Error code (valid only when !ok).
ok True when the operation succeeded.
value Result value (valid only when ok).

Description

Contextually converts to bool (true = success), so existing code using if (!ChartExporter::save(...)) continues to work without changes.

Template Parameters

Name Description
T Value type on success. Use the void specialisation for operations that return no value (e.g. ChartExporter::save).

Created with MrDocs