Hello all,
First of all, thanks for a wonderful library, it is a pleasure to work
with...
However I ran into some problems and I can not find the answers either
on the Internet nor on this mailing list. The problem at hand concerns
the multiindex container and bind.
I have a class with the following member:
class Statistics {
public:
void addStats ( double val, int tick );
}
and a container:
typedef multi_index_container< Statistics,
indexed_by
StatisticsMap;
StatisticsMap m_statistic;
indexed by :
typedef StatisticsMap::nth_index<1>::type StatisticsByResponse;
somewhere in code i try to do this :
std::pairStatisticsMap::iterator,bool result = m_statistic.insert(
Statistics( response, value, tick ) );
StatisticsByResponse& idxResponse = m_statistic.get<1>();
StatisticsByResponse::iterator it = m_statistic.project<1>(result.first );
the problem comes when I try to update the statistics by using :
for_each( it
, idxResponse.end()
, boost::bind( &Statistics::addStats, ::_1, val, tick )
);
" ...
\boost\boost\bind\mem_fn_template.hpp(260) : error C2440: 'argument' :
cannot convert from 'const
boost::multi_index::detail::index_node_base<Value>::value_type *' to
'Statistics *const '
with
[
Value=Statistics
]
Conversion loses qualifiers
boost\boost\bind.hpp(347) : see reference to function template
instantiation 'R boost::_mfi::mf2