mp_units::unit_symbol

Returns the textual symbol of a unit

Synopsis

Declared in <mp-units/framework/unit_text.h>

template<
    unit_symbol_formatting fmt = unit_symbol_formatting{},
    typename CharT = char,
    Unit U>
[[nodiscard]]
consteval
std::basic_string_view<CharT>
unit_symbol(U u);

Return Value

a view over the unit's symbol

NOTE

The return value should not be discarded.

Template Parameters

NameDescription
fmtthe formatting options to use
CharTthe character type used to represent the symbol
Uthe unit to obtain the symbol of

Parameters

NameDescription
uthe unit to obtain the symbol of