Native Dimension
An abstract dimension; distinct native dimensions are orthogonal
Context
Introduction
Identifies an abstract dimension, for example mass or time.
#include <xo/unit/dimension.hpp>
For example can use this enum to index basis members of a scaled_unit instance:
#include <xo/unit/quantity.hpp>
using namespace xo::qty;
auto x = q::kilometers(100) / q::hours(1);
auto bpu1 = x.lookup_dim(dim::time);
auto bpu2 = x.lookup_dim(dim::distance);
Enum
-
enum class xo::qty::dimension
represent an abstract dimension.
xo-unit units are expressed as a cartesian product of powers of these dimensions.
Values:
-
enumerator invalid
sentinel value. not a dimension
-
enumerator mass
weight. native unit = 1 gram
-
enumerator distance
distance. native unit = 1 meter
-
enumerator time
time. native unit = 1 second
-
enumerator currency
a currency amount. native unit depends on actual currency. For USD: one US dollar.
NOTE: multicurrency work not supported by xo-unit.
(1usd + 1eur) is well-defined.
(1sec + 1m) is not.
-
enumerator price
A screen price. The interpretation of prices is highly context dependent; expect useful to bucket separately from currenty amounts.
-
enumerator n_dim
not a dimension. comes last, counts entries
-
enumerator invalid