15 #include <string_view>
16 #include <type_traits>
22 static_assert(
sizeof...(Cs) > 0,
"Empty strings are disallowed");
25 static constexpr
const std::array<char,
sizeof...(Cs)>
value{{Cs...}};
26 static constexpr
const std::string_view
str{
value.data(),
value.size()};
30 template <
typename _ratio>
struct ratio_prefix : std::false_type {};
33 struct ratio_prefix<std::atto> : std::integral_constant<char, 'a'> {};
35 struct ratio_prefix<std::femto> : std::integral_constant<char, 'f'> {};
37 struct ratio_prefix<std::pico> : std::integral_constant<char, 'p'> {};
39 struct ratio_prefix<std::nano> : std::integral_constant<char, 'n'> {};
41 struct ratio_prefix<std::micro> : std::integral_constant<char, 'u'> {};
43 struct ratio_prefix<std::milli> : std::integral_constant<char, 'm'> {};
45 struct ratio_prefix<std::centi> : std::integral_constant<char, 'c'> {};
47 struct ratio_prefix<std::kilo> : std::integral_constant<char, 'k'> {};
49 struct ratio_prefix<std::mega> : std::integral_constant<char, 'M'> {};
51 struct ratio_prefix<std::giga> : std::integral_constant<char, 'G'> {};
53 struct ratio_prefix<std::tera> : std::integral_constant<char, 'T'> {};
55 struct ratio_prefix<std::peta> : std::integral_constant<char, 'P'> {};
57 struct ratio_prefix<std::exa> : std::integral_constant<char, 'E'> {};
62 template <
char _dimension_symbol,
typename _ratio,
63 typename _exponent = std::ratio<1>>
Namespace containing implementation details for SI.
Definition: acceleration.h:34
Definition: absorbed_dose.h:18
base template for ratio prefix, unusable
Definition: unit_symbol.h:30
Compile time string provider for conversion of unit types to strings.
Definition: unit_symbol.h:21
static constexpr const std::array< char, sizeof...(Cs)> value
Definition: unit_symbol.h:25
static constexpr const std::string_view str
Definition: unit_symbol.h:26
Base struct. Unusable needs template overloading.
Definition: unit_symbol.h:64