I’m just starting to use boost::lambda an boost::lambda::bind, and I do not understand why this do not work whith valarray :
namespace std{
class CToto{
public:
CToto(double _i): a(_i) {}
CToto(): a(0.0) {}
double get() const
{return a;}
private:
double a;
};
std::vector<std::CToto *> aTotoPtrVect;
aTotoPtrVect.push_back(new std::CToto(1.1));
aTotoPtrVect.push_back(new std::CToto(2.2));
aTotoPtrVect.push_back(new std::CToto(3.3));
aTotoPtrVect.push_back(new std::CToto(4.4));
std::vector <double> dv(std::distance((aTotoVect.begin(), aTotoVect.end());
std::for_each(aTotoPtrVect.begin(), aTotoPtrVect.end(), bll::var(dv)[bll::var(uiIdx)++] = bll::bind(&std::CToto::get, bll::_1)); // work fine
std::valaray <double> dvv(std::distance((aTotoVect.begin(), aTotoVect.end());
std::for_each(aTotoPtrVect.begin(), aTotoPtrVect.end(), bll::var(dvv)[bll::var(uiIdx)++] = bll::bind(&std::CToto::get, bll::_1)); // do not work
Is someone could explain me that ?