Skip to content

mp_units::unit_symbol_separator

Selects what separates the multiplied units of a unit symbol

Synopsis

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

enum class unit_symbol_separator : int;

Description

The default is a space. A typeset document may select a half-high dot instead:

constexpr std::string_view text_unit = unit_symbol(kg * m2 / s2);  // "kg m²/s²"
constexpr std::string_view dot_unit =
  unit_symbol<{.separator = unit_symbol_separator::half_high_dot}>(kg * m2 / s2);

Here dot_unit is kg⋅m²/s². The s and d tokens of a format specification select space and half_high_dot.

Members

NameDescription
space A space, as in kg m²/s²
half_high_dot A half-high dot, as in kg⋅m²/s², valid only with unicode, and an error with basic
default_separator [deprecated]The former default, space

See Also