Re: vector of abstract class
- To: mathgroup at smc.vnet.net
- Subject: [mg19555] Re: vector of abstract class
- From: "Martin v. Loewis" <martin at mira.isdn.cs.tu-berlin.de>
- Date: Wed, 1 Sep 1999 23:06:57 -0400
- References: <Pine.SOL.3.95.990830111315.6902C-100000@wizard.liquidaudio.com>
- Sender: owner-wri-mathgroup at wolfram.com
> 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