Есть объекты
class Some {
public :
int func(void) const;
};
typedef std::map <int, Some> SomeMap;
typedef std::map <std::string, SomeMap> Container;
и код
int pcount = 0;
BOOST_FOREACH(const Container::value_type& pair, map)
{
pcount += std::accumulate (
pair.second.begin(), pair.second.end(), 0U,
boost::lambda::_1 +
boost::lambda::bind (&Some::func,
boost::lambda::bind (&SomeMap::value_type::second, boost::lambda::_2)
)
);
}
что поменялось ?
раньше данный код варился нормально,
а на boost 1.44.0 выдает
e:\library\boost\1.44.0\boost\lambda\detail\function_adaptors.hpp(264) : error C2440: 'return' : cannot convert from 'const Some' to 'rt1 '
1> Conversion loses qualifiers
1> e:\library\boost\1.44.0\boost\lambda\detail\actions.hpp(87) : see reference to function template instantiation 'RET boost::lambda::function_adaptor<Func>::apply<RET>(T std::pair<_Ty1,_Ty2>::* ,const Object &)' being compiled
1> with
1> [
1> RET=rt1,
1> Func=Some std::pair<const int,Some>::* ,
1> T=Some,
1> _Ty1=int,
1> _Ty2=Some,
1> Object=std::pair<const int,Some>
1> ]
...