Boost C++ Libraries: Ticket #7138: Output of a UDT with autoprefix requires specialization of auto_prefix_norm https://svn.boost.org/trac10/ticket/7138 <p> Output of a UDT with autoprefix requires specialization of auto_prefix_norm for the scaling to take place. For example, to get expected scaling to kilometers from </p> <p> quantity&lt;length, measurement&lt;double&gt; &gt; biglen(measurement&lt;double&gt;(12345.0,123.0)*meters); autoscaled = 12.345(+/-0.123) km </p> <p> This can be achieved by adding this to measurement.hpp (where Y is the type of UDT) </p> <pre class="wiki">// Specialization of autoprefix_norm for UDTboost::units::measurement&lt;Y&gt; // See io.hpp. // This specialization is required to get autoprefix to work with this class. template&lt;class Y&gt; typename autoprefix_norm_impl&lt;boost::units::measurement&lt;Y&gt;, true&gt;::type autoprefix_norm(const boost::units::measurement&lt;Y&gt; &amp; arg) { return autoprefix_norm_impl&lt;Y, true&gt;::call(arg); } </pre><p> However this assumes that the class Y is convertible to double. autoprefix_norm_impl&lt;T, true&gt;::type appears to be always double. I am unclear if this is checked or is the responsibility or the user? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7138 Trac 1.4.3