Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

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



  • Prev by Date: Re: Avoid out of memory in Simplify
  • Next by Date: Re: Experimental Functions in Mathematica 4.0
  • Previous by thread: Re: Re: Double evaluation in recursive function
  • Next by thread: Re: Experimental Functions in Mathematica 4.0