Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda] newbie: lambda to help in std::accumulate
From: Micha³ Nowotka (mmmnow_at_[hidden])
Date: 2009-01-29 11:06:05


Ok, i now I've corrected my method to:

double evaluate(const vector<double>& win_probabls)
{
        return accumulate (win_probabls.begin(), win_probabls.end(), 0,
lambda::_1 + lambda::bind(log, lambda::_2) );
}

and got following warning (which i can't understand):

c:\program files\boost\boost_1_36_0\boost\lambda\detail\lambda_traits.hpp(389)
: warning C4180: qualifier applied to function type has no meaning;
ignored
c:\program files\boost\boost_1_36_0\boost\lambda\detail\lambda_traits.hpp(458)
: see reference to class template instantiation
'boost::lambda::detail::bind_traits<T>' being compiled
with
[
       T=double (double)
]
c:\users\kott\documents\visual studio
2008\projects\mbi\implementation\src\main.cpp(613) : see reference to
class template instantiation
'boost::lambda::detail::bind_tuple_mapper<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9>'
being compiled
with
[
      T0=double (double),
      T1=boost::lambda::placeholder2_type,
      T2=boost::tuples::null_type,
      T3=boost::tuples::null_type,
      T4=boost::tuples::null_type,
      T5=boost::tuples::null_type,
      T6=boost::tuples::null_type,
      T7=boost::tuples::null_type,
      T8=boost::tuples::null_type,
      T9=boost::tuples::null_type
]
c:\users\kott\documents\visual studio
2008\projects\mbi\implementation\src\main.cpp(698) : warning C4267:
'initializing' : conversion from 'size_t' to 'const int', possible
loss of data
c:\program files\microsoft visual studio 9.0\vc\include\numeric(45) :
warning C4244: '=' : conversion from 'double' to 'int', possible loss
of data
c:\program files\microsoft visual studio 9.0\vc\include\numeric(54) :
see reference to function template instantiation '_Ty
std::_Accumulate<std::_Vector_const_iterator<double,_Alloc>,_Ty,_Fn2>(_InIt,_InIt,_Ty,_Fn2)'
being compiled
with
[
     _Ty=int,
     _Alloc=std::allocator<double>,
           _Fn2=boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::arithmetic_action<boost::lambda::plus_action>,boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholder<1>>,boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::action<2,boost::lambda::function_action<2,double>>,boost::tuples::tuple<double
(__cdecl &)(double),const
boost::lambda::lambda_functor<boost::lambda::placeholder<2>>,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type>>>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>,
           _InIt=std::_Vector_const_iterator<double,std::allocator<double>>
]
c:\users\kott\documents\visual studio
2008\projects\mbi\implementation\src\main.cpp(613) : see reference to
function template instantiation '_Ty
std::accumulate<std::_Vector_const_iterator<double,_Alloc>,int,boost::lambda::lambda_functor<T>>(_InIt,_InIt,_Ty,_Fn2)'
being compiled
      with
[
         _Ty=int,
         _Alloc=std::allocator<double>,
           T=boost::lambda::lambda_functor_base<boost::lambda::arithmetic_action<boost::lambda::plus_action>,boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholder<1>>,boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::action<2,boost::lambda::function_action<2,double>>,boost::tuples::tuple<double
(__cdecl &)(double),const
boost::lambda::lambda_functor<boost::lambda::placeholder<2>>,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type>>>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>,
           _InIt=std::_Vector_const_iterator<double,std::allocator<double>>,
          _Fn2=boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::arithmetic_action<boost::lambda::plus_action>,boost::tuples::tuple<boost::lambda::lambda_functor<boost::lambda::placeholder<1>>,boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::action<2,boost::lambda::function_action<2,double>>,boost::tuples::tuple<double
(__cdecl &)(double),const
boost::lambda::lambda_functor<boost::lambda::placeholder<2>>,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type>>>,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>>>
]

what I'm doing wrong?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net