
15 Sep
2009
15 Sep
'09
7:24 p.m.
What is the correct way to override the << op for a unit so that it say prints "Pa" instead of "m^-1 kg s^-2"? I tried this and no worky: #include <boost/units/io.hpp> namespace boost { namespace units { template<> inline std::string name_string< boost::units::pressure_dimension, boost::units::si::system
(const boost::units::si::pressure&) { return "Pa"; }
}} // boost::units Also, I note that the operator << in io.hpp has a comment saying "INTERNAL USE ONLY". How would you suggest then that users of the library provide for stream output without running afoul of this implementation we're not meant to use?