forked from mpusz/mp-units
refactor: quantity_io added
This commit is contained in:
@@ -314,21 +314,6 @@ public:
|
||||
#endif
|
||||
|
||||
[[nodiscard]] friend constexpr bool operator==(const quantity& lhs, const quantity& rhs) = default;
|
||||
|
||||
template<class CharT, class Traits>
|
||||
friend std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const quantity& q)
|
||||
requires requires { os << q.count(); }
|
||||
{
|
||||
if(os.width()) {
|
||||
// std::setw() applies to the whole quantity output so it has to be first put into std::string
|
||||
std::basic_ostringstream<CharT, Traits> s;
|
||||
detail::to_stream(s, q);
|
||||
return os << s.str();
|
||||
}
|
||||
|
||||
detail::to_stream(os, q);
|
||||
return os;
|
||||
}
|
||||
};
|
||||
|
||||
// CTAD
|
||||
|
||||
Reference in New Issue
Block a user