In function
|
std::string to_string(const measurement& measure, std::uint32_t match_flags) |
|
{ |
|
std::stringstream ss; |
|
ss.precision(6); |
|
ss << measure.value(); |
|
ss << ' '; |
|
auto str = to_string(measure.units(), match_flags); |
|
if (isNumericalStartCharacter(str.front())) { |
|
str.insert(str.begin(), '('); |
|
str.push_back(')'); |
|
} |
|
ss << str; |
|
return ss.str(); |
|
} |
the call
auto str = to_string(measure.units(), match_flags);
may return an empty string.
This will cause a crash when using str.front()
.