Commit 30151f41 authored by Jan Koniarik's avatar Jan Koniarik
Browse files

added operator<< for quantity

parent bb9bc6ae
......@@ -7,6 +7,10 @@
#include <string>
#include <type_traits>
#ifdef EMLABCPP_USE_STREAMS
#include <ostream>
#endif
#pragma once
namespace emlabcpp
......@@ -233,6 +237,14 @@ constexpr ValueType operator/( const ValueType val, const quantity< Derived, Val
return val / *q;
}
#ifdef EMLABCPP_USE_STREAMS
template < typename T, typename ValueType >
inline std::ostream& operator<<( std::ostream& os, quantity< T, ValueType > q )
{
return os << *q << T::get_unit();
}
#endif
} // namespace emlabcpp
/// The quantity has defined partital specialization of std::numeric_limits,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment