The type of the value type stored in the Quantity struct.
A prefilled SymbolList struct that contains all units and prefixes.
A function that can parse the beginning of a string to return a numeric value of type N. After this function returns, it must have consumed the numeric part and leave only the unit part.
enum bit = unit!("bit", ulong); alias BinarySize = typeof(bit); enum byte_ = 8 * bit; enum symbolList = makeSymbolList!ulong( withUnit("bit", bit), withUnit("B", byte_), withPrefix("hob", 7) ); alias sz = ctQuantityParser!(ulong, symbolList); assert(sz!"1 hobbit".value(bit) == 7);
Creates a compile-time parser capable of working on user-defined units and prefixes.
Contrary to a runtime parser, a compile-time parser infers the type of the parsed quantity automatically from the dimensions of its components.