[C++-sig] Wrapping std::vector<AbstractClass*>

Joel de Guzman djowel at gmail.com
Tue Jul 5 13:37:27 CEST 2005

Paul Melis wrote:
> Hello,
> I have an abstract class and a std::vector<> of pointers to this class. 
> A routine in my c++ code fills a vector with objects of classes derived 
> from the abstract class.
> I'd like to iterate over the vector in python and use each of the items 
> in the vector depending on the type of derived class.
> I suspect that boost.python will wrap the return value of returnList() 
> as a pointer to Abstract, without the possibility at runtime to look at 
> the actual object type. Is this something I would have to code by hand? 
> For example, by making a routine that takes a pointer to Abstract and 
> uses dynamic_cast<> to test which of the concrete classes the object 
> actually is from?

Pardon the delay. It's been a while. I'm investigating the problem
in more detail. I'll get back to you on this, ok?

Joel de Guzman

More information about the Cplusplus-sig mailing list