c++ - std::transform using C++0x lambda expression -


how done in c++0x?

std::vector<double> myv1; std::transform(myv1.begin(), myv1.end(), myv1.begin(),                std::bind1st(std::multiplies<double>(),3)); 

original question , solution here.

std::transform(myv1.begin(), myv1.end(), myv1.begin(),     [](double d) -> double { return d * 3; }); 

Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -