How to using Std:transform + Lambda function?

  • Thread starter Thread starter Khanh01
  • Start date Start date
K

Khanh01

Guest
Hi,I'm having trouble using transforms, this is the code I use:

std::vector<PT3D> vcen { PT3D{1,1}, PT3D{4,4}}; //List Center Point of Circles
std::vector<VT3D> vztor{ normalZ , normalZ }; //List vector Oz (0,0,1)
std::vector<float> vrad { 1 , 2 }; //List radius of Circles

//define Circles from 3 vector above then push to this vector

std::vector<CIR> vcir; //contains list circle

//Transform + Lambda -> creat list circle variable

std::transform(vcen.begin(), vcen.end(), vztor.begin(), vrad.begin(),

[](PT3D p1, VT3D v, float r)->{vcir.push_back(new CIR{p1,v,r})});





However this does not work, the errors I received:

image1:----------------------------------------------

1538029.png


image2:---------------------------------------------------------------------

1538020.png



where am i wrong? Please everyone help.....

Thanks you!


Continue reading...
 
Back
Top