Re: [Boost-bugs] [Boost C++ Libraries] #8181: Accumulator : compilation error due to average function

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8181: Accumulator : compilation error due to average function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-26 14:40:05


#8181: Accumulator : compilation error due to average function
----------------------------------------------------------+-----------------
  Reporter: Cecile Daversin <daversin.cecile@…> | Owner: eric_niebler
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: accumulator
   Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------------------------+-----------------

Old 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

New 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

--
Comment (by marshall):
 (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.
-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8181#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC