Boost C++ Libraries: Ticket #5302: [accumulator] Generalise type arithmetics, e.g. make it play well with boost.units. https://svn.boost.org/trac10/ticket/5302 <p> Accumulators library assumes that for an accumulated type T*T is also of type T. This makes it difficult to play it well with boost.unit for example; specially for the variance accumulator. </p> <p> Based on <a class="ext-link" href="http://groups.google.com/group/boostusers/msg/86ebe100e3a86794"><span class="icon">​</span>http://groups.google.com/group/boostusers/msg/86ebe100e3a86794</a> Below is the goal code: </p> <p> #include&lt;boost/accumulators/accumulators.hpp&gt; #include &lt;boost/accumulators/statistics/variance.hpp&gt; #include&lt;boost/units/systems/si.hpp&gt; #include&lt;boost/units/io.hpp&gt; </p> <p> using namespace boost::accumulators; using namespace boost::units; int main(){ </p> <blockquote> <p> accumulator_set&lt; </p> <blockquote> <p> quantity&lt;si::time&gt;, features&lt; </p> <blockquote> <p> tag::variance, </p> <blockquote class="citation"> <p> a; </p> </blockquote> </blockquote> </blockquote> <p> a(1.0*si::second); a(2.0*si::second); a(3.0*si::second); std::cout </p> <blockquote> <p> &lt;&lt; extract::variance(a) </p> </blockquote> <p> ; return 0; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5302 Trac 1.4.3