I want to copy all the integers contained in a
into b
.
#include <vector>
#include <iterator>
#include <boost/bind.hpp>
#include <boost/range/algorithm/for_each.hpp>
#include <boost/range/algorithm/copy.hpp>
void test()
{
std::vector<std::vector<int> > a;
std::vector<int> b;
boost::for_each(a, boost::bind(boost::copy, _1, std::back_inserter(b)));
}
It looks so simple. I'd like to have a C++ 98 compatible one liner.
Why doesn't this compile?
I have a long list of error regarding boost::bind
, which I don't understand, moreover, it is multiple pages long.
The error starts with :
error C2780: 'boost::_bi::bind_t<_bi::dm_result::type,boost::_mfi::dm,_bi::list_av_1::type> boost::bind(M T::* ,A1)' : expects 2 arguments - 3 provided