Opened 10 years ago
Last modified 10 years ago
#8181 closed Bugs
Accumulator : compilation error due to average function — at Version 1
Reported by: | Owned by: | Eric Niebler | |
---|---|---|---|
Milestone: | To Be Determined | Component: | accumulator |
Version: | Boost 1.49.0 | Severity: | Problem |
Keywords: | Cc: |
Description (last modified by )
Hello, I'm trying to use accumulators to compute the mean of a set of double. Firstly, I instantiate an accumulator_set object using the correct tag, as following :
#include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics.hpp> typedef boost::accumulators::accumulator_set<double, boost::accumulators::stats< boost::accumulators::tag::mean > > accumulator_type; accumulator_type acc;
I try to compile this code with clang and with gcc(4.6), and both of them give the same kind of error :
With clang : /usr/include/boost/accumulators/statistics/mean.hpp:42:48: error: too many arguments provided to function-like macro invocation return numeric::average(sum(args), count(args));
With gcc : /usr/include/boost/accumulators/statistics/mean.hpp:42:59: error: macro "average" passed 2 arguments, but takes just 1
(Description edited to make the code more obvious)
I tried compiling your code with gcc 4.2.1 and clang, and both compiled it correctly.
I suspect that you need to post more code.