mp_units::vector_axes¶
Ordered list of the 1D-vector component axes a vector quantity decomposes into
Synopsis¶
Declared in <mp-units/framework/vector_components.h>
template<QuantitySpec auto Axes...>
requires detail::ValidVectorAxes<Axes...>
struct vector_axes;
Description¶
A user opts a vector whole into decomposition by specializing vector_components (the customization point in customization_points.h) and inheriting from this template, listing the per-axis quantity specs in coordinate order:
template<>
struct mp_units::vector_components<flight_velocity> :
mp_units::vector_axes<forward_velocity, wind_drift, sink_rate> {};
The axis-intrinsic preconditions are enforced here: every axis must be a vector quantity, the axes must share a common hierarchy root (be the same kind of quantity), and they must be pairwise-distinct kinds (declare each with is_kind). A specialization that violates them is ill-formed at the point of definition. The relational preconditions (axes share the whole's hierarchy root, differ from the whole's kind, and fit the representation) need the whole and the representation, so they are enforced when a quantity is actually decomposed.
Specializing this template is optional. A vector quantity without one still decomposes, with each component carrying the whole's kind instead of an axis of its own, and access by axis spec unavailable. The declaration buys that per-axis type safety.