C ++ Iterando a través de un vector de punteros inteligentes.
Tengo una clase que tiene esta función:
typedef boost::shared_ptr<PrimShapeBase> sp_PrimShapeBase;
class Control{
public:
//other functions
RenderVectors(SDL_Surface*destination, sp_PrimShapeBase);
private:
//other vars
vector<sp_PrimShapeBase> LineVector;
};
//the problem of the program
void Control::RenderVectors(SDL_Surface*destination, sp_PrimShapeBase){
vector<sp_PrimShapeBase>::iterator i;
//iterate through the vector
for(i = LineVector.begin(); i != LineVector.end(); i ++ ){
//access a certain function of the class PrimShapeBase through the smart
//pointers
(i)->RenderShape(destination);
}
}
El compilador me dice que la clase boost :: shared_ptr no tiene ningún miembro llamado 'RenderShape', lo que me parece extraño ya que la clase PrimShapeBase ciertamente tiene esa función pero está en un archivo de encabezado diferente. ¿Cuál es la causa de esto?