cheatah
Struct

space::irbem::Result

cheatah-space v0.1.0-alpha — Biome Standard 0.6.5-alpha

A computed value and the reason it may not be trustworthy.

An aggregate on purpose: no constructors, no invariants, no accessors beyond ok. That is what keeps it trivially copyable — the property the GPU lane needs, since a Result<float> array is memcpy'd out of a device buffer — and what lets it be built with {Status::Ok, x} at every one of the several hundred call sites this library will eventually have.

The status member is first so that the layout is the same one the device writes: a small integer tag followed by the payload at its natural alignment.

Template parameters
T

the value type; anything trivially copyable, in practice double, float, or a cheatah::fixarray vector.

Unit testIrbemStatus.ResultIsTriviallyCopyableAndSmall

Functions

fn bool ok() const #

Whether the value carries no caveat.

Returns

true only when status is Status::Ok.

Complexity

O(1).

Allocation

none.

Unit testIrbemStatus.ResultOkTracksItsStatus

Constants & variables

var Status status #

Why the value may not be trustworthy; Status::Ok when it may.

var T value #

The computed value — always populated, including when status is Status::OutOfValidityRange.

See the file brief.