carb::variant::VariantData

Defined in carb/variant/VariantTypes.h

struct VariantData

A standard-layout.

ABI-safe struct for communicating variant data. This struct is filled out by Translator specializations.

This class should generally not be used directly except by Translator specializations. Instead use the Variant wrapper-class.

See also

Translator, Variant

Subclassed by carb::variant::Variant

Public Members

const VTable *vtable

The v-table for this variant. Only empty variants are allowed a nullptr v-table. The v-table is used to provide functions for variant behavior and can be used as a type-identifier of sorts.

void *data

A generic pointer whose interpretation is based on the v-table and the Translator specialization that created it.