punits][accumulators] buggy behavior for min accumulator of quantities
Hi,
Sometimes it is difficult to make boost::units quantities with other
libraries. For example to have boost::accumulators mean work with
units, one has to specialize division by integer for quantities.
In this example the accumulators and units compiles out of the box but
gives an incorrect answer.
#include
Answering to myself:
On Mar 12, 3:04 pm, alfC
Hi, Sometimes it is difficult to make boost::units quantities with other libraries. For example to have boost::accumulators mean work with units, one has to specialize division by integer for quantities.
In this example the accumulators and units compiles out of the box but gives an incorrect answer.
I found the solution, just add
#include
On 3/13/2011 7:45 AM, alfC wrote:
Anyway, I would suggest to the authors of boost.units to include limits.hpp by default in the core library in order *to avoid this surprises*. Or better yet, make the author of boost.accumulators to support boost.units. <snip>
This is a known shortcoming of Boost.Accumulators. Things get complicated when t*t has a different type than t and such. Sprinkling BOOST_DECLTYPE (or decltype where it's supported) would solve the issue, but finding all such assumptions everywhere would be hard. Appropriate use of a degenerate numeric archetype in all the tests would do it, but adding that and then adding decltype everywhere would be a big job. But you should file a bug, anyway. Thanks, -- Eric Niebler BoostPro Computing http://www.boostpro.com
Eric,
This is a known shortcoming of Boost.Accumulators. Things get complicated when t*t has a different type than t and such. Sprinkling BOOST_DECLTYPE (or decltype where it's supported) would solve the issue, but finding all such assumptions everywhere would be hard. Appropriate use of a degenerate numeric archetype in all the tests would do it, but adding that and then adding decltype everywhere would be a big job. But you should file a bug, anyway.
Thanks, bug submited. https://svn.boost.org/trac/boost/ticket/5302 (I forgot to use the wiki code formatting, sorry)
Thanks,
-- Eric Niebler BoostPro Computinghttp://www.boostpro.com _______________________________________________ Boost-users mailing list Boost-us...@lists.boost.orghttp://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
alfC
-
Eric Niebler