[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    Re: vector of abstract class
From:       "Martin v. Loewis" <martin () mira ! isdn ! cs ! tu-berlin ! de>
Date:       1999-08-31 9:40:24
[Download RAW message or body]

> 	I shouldn't be allowed to have a vector of an abstract class,
> 	should I?

Why not? Instantiating the vector template does not require creation
of a member element. If you actually try to push_back an element, or
if you initialize the vector as

  vector<S> v(10);

(with 10 empty elements), you'll get the error you expect.

Regards,
Martin

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic