Opened 10 years ago

Last modified 10 years ago

#8181 closed Bugs

Accumulator : compilation error due to average function — at Initial Version

Reported by: Cecile Daversin <daversin.cecile@…> Owned by: Eric Niebler
Milestone: To Be Determined Component: accumulator
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

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

Change History (0)

Note: See TracTickets for help on using tickets.