If I turn on gcc's -Wextra option when compiling code that uses an
accumulator with tag::max, I get a screen full of compiler warnings:
[wheeler@cib: /var/tmp/acc] cat acc.cpp
#include <iostream>
#include
#include
#include
using namespace boost::accumulators;
int main()
{
accumulator_settag::max > acc;
acc(1.2);
acc(2.3);
acc(3.4);
acc(4.5);
std::cout << "Max: " << max(acc) << std::endl;
return 0;
}
[wheeler@cib: /var/tmp/acc] g++ -W -I /opt/ros/include/boost-1_37/ acc.cpp
-o acc
/opt/ros/include/boost-1_37/boost/concept_check.hpp: In instantiation of
‘boost::UnaryFunction, double, const double&>’:
/opt/ros/include/boost-1_37/boost/concept/detail/has_constraints.hpp:40:
instantiated from ‘const bool
boost::concept::not_satisfied, double, const double&> >::value’
/opt/ros/include/boost-1_37/boost/concept/detail/has_constraints.hpp:43:
instantiated from
‘boost::concept::not_satisfied, double, const double&> >’
/opt/ros/include/boost-1_37/boost/mpl/if.hpp:67: instantiated from
‘boost::mpl::if_, double, const double&> >,
boost::concept::constraint, double, const double&> >,
boost::concept::requirement, double, const double&> > >’
/opt/ros/include/boost-1_37/boost/concept/detail/general.hpp:19:
instantiated from ‘boost::concept::requirement_, double, const double&>)>’
/opt/ros/include/boost-1_37/boost/accumulators/numeric/detail/function1.hpp:67:
instantiated from ‘typename
boost::detail::function1<F>::result::type boost::detail::function1<F>::operator()(const A0&) const [with
A0 = double, F =
boost::numeric::functional::as_min,
boost::numeric::functional::tag > >]’
/opt/ros/include/boost-1_37/boost/accumulators/statistics/max.hpp:36:
instantiated from
‘boost::accumulators::impl::max_impl<Sample>::max_impl(const Args&) [with
Args =
boost::parameter::aux::arg_list, void> >,
boost::parameter::aux::empty_arg_list>, Sample = double]’
/opt/ros/include/boost-1_37/boost/accumulators/framework/depends_on.hpp:282:
instantiated from
‘boost::accumulators::detail::accumulator_wrapper::accumulator_wrapper(const Args&) [with Args =
boost::parameter::aux::arg_list, void> >,
boost::parameter::aux::empty_arg_list>, Accumulator =
boost::accumulators::impl::max_impl<double>, Feature =
boost::accumulators::tag::max]’
/opt/ros/include/boost-1_37/boost/accumulators/framework/depends_on.hpp:215:
instantiated from ‘static boost::fusion::cons::value>::type>
boost::accumulators::detail::build_acc_list::call(const
Args&, const First&, const Last&) [with Args =
boost::parameter::aux::arg_list, void> >,
boost::parameter::aux::empty_arg_list>, First =
boost::fusion::mpl_iterator, boost::mpl::vector0, 0>, 0l> >,
Last =
boost::fusion::mpl_iterator, boost::mpl::vector0, 0>, 1l> >]’
/opt/ros/include/boost-1_37/boost/accumulators/framework/depends_on.hpp:234:
instantiated from ‘typename
boost::accumulators::detail::meta::make_acc_list<Sequence>::type
boost::accumulators::detail::make_acc_list(const Sequence&, const Args&)
[with Sequence =
boost::mpl::v_item, boost::mpl::vector0, 0>, Args =
boost::parameter::aux::arg_list, void> >,
boost::parameter::aux::empty_arg_list>]’
/opt/ros/include/boost-1_37/boost/accumulators/framework/accumulator_set.hpp:145:
instantiated from ‘boost::accumulators::accumulator_set::accumulator_set() [with Sample = double, Features =
boost::accumulators::stats, Weight = void]’
acc.cpp:9: instantiated from here
/opt/ros/include/boost-1_37/boost/concept_check.hpp:325: warning: non-static
reference ‘const double&
boost::UnaryFunction,
double, const double&>::arg’ in class without a constructor