delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/09/25/00:37:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <79218202D4B9D4118A290002A508E13B79C39B@PNZEXCHANGE>
From: Ross Smith <rosss AT pharos DOT co DOT nz>
To: "'Emil Briggs'" <emil AT baymountain DOT com>, Ross Smith <rosss AT pharos DOT co DOT nz>
Cc: cygwin AT cygwin DOT com
Subject: RE: limit for # of items created with "new" ?
Date: Wed, 25 Sep 2002 16:36:33 +1200
MIME-Version: 1.0

> From: Emil Briggs [mailto:emil AT baymountain DOT com]
> 
> On Tuesday 24 September 2002 10:28 pm, Ross Smith wrote:
> > From: Hans Horn [mailto:hannes AT 2horns DOT com]
> >
> > > // an element of a linked list
> > > typedef struct node {
> > >   node (int _v, node* _n) : v(_v), next(_n) {}
> > >   int   v;
> > >   node* next;
> > > };
> >
> > I'm surprised that compiled; the typedef shouldn't be there.
> >
> > > int main (int argc, char** argv) {
> > >   // allocate descriptions of points
> > >   char** points = new char*[NUM_POINTS]; assert(points);
> >
> > The assert is superfluous; new is guaranteed never to return null.
> >
> 
> Except when you are out of memory.

No. It throws a std::bad_alloc exception.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019