diff --git a/example/alternative_namespaces/conversion_factor.cpp b/example/alternative_namespaces/conversion_factor.cpp index 28812a6d..900d0552 100644 --- a/example/alternative_namespaces/conversion_factor.cpp +++ b/example/alternative_namespaces/conversion_factor.cpp @@ -56,7 +56,7 @@ int main() std::cout << "therefore ratio lengthA / lengthB == " << lengthA / lengthB << "\n\n"; std::cout << "conversion factor from lengthA::unit of " - << units_str(lengthA) << " to lengthB::unit of " << units_str(lengthB) << " :\n\n" + << units_str(lengthA).standard() << " to lengthB::unit of " << units_str(lengthB).standard() << " :\n\n" << "lengthB.count( " << lengthB.count() << " ) == lengthA.count( " << lengthA.count() << " ) * conversion_factor( " << conversion_factor(lengthB, lengthA) << " )\n"; } diff --git a/src/include/units/bits/to_string.h b/src/include/units/bits/to_string.h index 3e91f9da..89fae646 100644 --- a/src/include/units/bits/to_string.h +++ b/src/include/units/bits/to_string.h @@ -168,8 +168,8 @@ std::basic_string to_string(const Q& q) std::basic_ostringstream s; s << q.count(); constexpr auto symbol = unit_text(); - if constexpr (symbol.size()) { - s << " " << symbol; + if constexpr (symbol.standard().size()) { + s << " " << symbol.standard(); } return s.str(); } diff --git a/src/include/units/format.h b/src/include/units/format.h index 67997238..f88ce216 100644 --- a/src/include/units/format.h +++ b/src/include/units/format.h @@ -456,9 +456,9 @@ public: // default format should print value followed by the unit separated with 1 space to_quantity_buffer = units::detail::format_units_quantity_value(to_quantity_buffer, q.count(), rep_specs); constexpr auto symbol = units::detail::unit_text(); - if(symbol.size()) { + if(symbol.standard().size()) { *to_quantity_buffer++ = CharT(' '); - format_to(to_quantity_buffer, "{}", symbol.c_str()); + format_to(to_quantity_buffer, "{}", symbol.standard().c_str()); } } else { diff --git a/src/include/units/symbol_text.h b/src/include/units/symbol_text.h index c952cfba..c10fe2cc 100644 --- a/src/include/units/symbol_text.h +++ b/src/include/units/symbol_text.h @@ -21,9 +21,6 @@ struct basic_symbol_text { [[nodiscard]] constexpr auto& ascii() { return ascii_; } [[nodiscard]] constexpr const auto& ascii() const { return ascii_; } - [[nodiscard]] constexpr std::size_t size() const noexcept { return standard_.size(); } - [[nodiscard]] constexpr const StandardCharT* c_str() const noexcept { return standard_.c_str(); } - template [[nodiscard]] constexpr friend basic_symbol_text operator+( const basic_symbol_text& lhs, const basic_symbol_text& rhs) noexcept @@ -67,13 +64,6 @@ struct basic_symbol_text { { return false; } - - template - friend std::basic_ostream& operator<<(std::basic_ostream& os, - const basic_symbol_text& symbol) - { - return os << symbol.standard_.c_str(); - } }; template