converting vector of pointeur to vector of pointeur to const
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hi ! I have a vector like : vector<myclass*> I need to return this vector as : vector<const myclass*> but I don't see any easy way to do it ! Do I really have to take each item of the original vector and add it to the target vector, converting it to const in the process ? Thanks for your help ! Jerome
-
Hi ! I have a vector like : vector<myclass*> I need to return this vector as : vector<const myclass*> but I don't see any easy way to do it ! Do I really have to take each item of the original vector and add it to the target vector, converting it to const in the process ? Thanks for your help ! Jerome
vector myVec; ... vector myConstVec(myVec.begin(), myVec.end());