S
stephen henry
Hi all,
I'm trying to create a vector of pointers to a class:
For example:
class CMb ...
std::vector< CMb* > myvect(100);
myvect[10] = new CMb();
But this doesn't work. g++ just spews out a whole load of uninituitive
errors around the assignment operation.
So, have just read a post on this newsgroup from a few years ago, I'm
trying to use an auto_ptr instead.
so,
std::vector< std::auto_ptr<CMb> > myvect(100);
myvect[10] = new CMb();
But, this time the compiler complains that passing const
std::auto_ptr<CMb> discards a qualifier.
How to I fix this?
Thanks,
Stephen
I'm trying to create a vector of pointers to a class:
For example:
class CMb ...
std::vector< CMb* > myvect(100);
myvect[10] = new CMb();
But this doesn't work. g++ just spews out a whole load of uninituitive
errors around the assignment operation.
So, have just read a post on this newsgroup from a few years ago, I'm
trying to use an auto_ptr instead.
so,
std::vector< std::auto_ptr<CMb> > myvect(100);
myvect[10] = new CMb();
But, this time the compiler complains that passing const
std::auto_ptr<CMb> discards a qualifier.
How to I fix this?
Thanks,
Stephen