From 6701941954482289348
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,81cfa62a82013905,start
X-Google-Attributes: gidf78e5,public
From: "John D. Hickin" <hickin@CAM.ORG>
Subject: bad_alloc
Date: 1997/10/02
Message-ID: <3433222F.5644@CAM.ORG>#1/1
X-Deja-AN: 277221546
X-Original-Date: Thu, 02 Oct 1997 00:25:19 -0400
Reply-To: hickin@CAM.ORG
Organization: Communications Accessibles Montreal, Quebec Canada
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUANDM33+EDnX0m9pzZAQEkRwF+ML8RUcVg8t19sCUkltCvRmYexBeQBUFF kpu9+2jaut+UKZ8If+pLo9ZW1BCSN84W =GZ4I
Newsgroups: comp.std.c++


The following snippet of code produced a stack overflow.  Is this an
artifact of the standard or of the implementation?

	try { while ( new char[42] ); }
	catch( const std::bad_alloc& ) { }

Evidently we require some memory to build a bad_alloc.  The standard
says that bad_alloc() won't throw.  Can this be insured?
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



