C++ Iterating through a vector of smart pointers

前端 未结 2 1201
别那么骄傲
别那么骄傲 2021-02-08 07:50

i have a class that has this function:

typedef boost::shared_ptr sp_PrimShapeBase; 



class Control{
     public:
         //other function         


        
2条回答
  •  天命终不由人
    2021-02-08 08:07

    Don't you mean

    (*i)->RenderShape(destination); 
    

    ?

    i is the iterator, *i is the shared_ptr, (*i)::operator->() is the object.

提交回复
热议问题