From 430443120993509719
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc772,10e355266b6fd117
X-Google-Attributes: gidfc772,public
X-Google-Thread: f78e5,10e355266b6fd117
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-06-01 18:22:11 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!paloalto-snh1.gtei.net!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!sunnews1.Eng.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: gneppert@web.de (McNepp)
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: A humble attempt to suggest alignment support for C++
Date: 2 Jun 2002 01:12:32 GMT
Organization: http://groups.google.com/
Lines: 40
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <53e3f3b2.0205302330.67a3eeb5@posting.google.com>
References: <3CEA1A08.C6D95CC7@lmf.ericsson.se>
 <53e3f3b2.0205270557.bdd703d@posting.google.com>
 <ad0l2u$4vn$1@bob.news.rcn.net>
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPPhHAkHMCo9UcraBAQFwVwH/Qb82Af0c3X9tWn+4+hcRj+RODpwhqo/K
	SlfEPBjok5zFy7mcdxyKYQ7WGCZrE/crS2QsPNEWuMCAtoBmiIIvHA==
	=6ZSU
X-Approved-For-Group: jep@[151.161.11.6] comp.lang.c++.moderated
X-Original-Date: 1 Jun 2002 00:01:10 -0400
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPPlYGkHMCo9UcraBAQHgXAH+P3Oo+Qnq1D8MPTlXyK5GSUI+a8V0DDrY
	u6EyVqLeRygFAIaVDTqd7Gw0mUVebzeDj6YShD/d5ooPf190UKPptw==
	=Lktd
X-Approved-For-Group: kuehl@fmi.uni-konstanz.de comp.lang.c++.moderated
X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang)
Content-Length: 1582
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:11774 comp.lang.c++.moderated:44382


"David Abrahams" <david.abrahams@rcn.com> wrote in message news:<ad0l2u$4vn$1@bob.news.rcn.net>...
> "McNepp" <gneppert@web.de> wrote in message
> news:53e3f3b2.0205270557.bdd703d@posting.google.com...
> > What about allowing this syntax:
> >
> > void buffer[ count * sizeof(T) ];
> >
> > This generic buffer can be safely cast (with one simple static_cast) 
> > to any type T. No new keywords needed, simple and self-explanatory, 
> > isn't it?
> 
> ...but very wasteful in generic code where T might turn out to be char.
> 

Sure, it may waste a few bytes, but it is supposed to be a simple,
fast, stack-based replacement for dynamic memory allocation on the
heap. This purpose it would serve well enough, and why bother about a
few wasted bytes if the alternative was highly expensive (and, BTW,
wasteful, too) malloc/operator new calls?



      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]

[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]




[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]




