This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: operator new with placement
- To: carlo at runaway dot xs4all dot nl, egcs-bugs at egcs dot cygnus dot com
- Subject: Re: operator new with placement
- From: Mike Stump <mrs at wrs dot com>
- Date: Mon, 11 Oct 1999 17:11:05 -0700 (PDT)
> From: Carlo Wood <carlo@runaway.xs4all.nl>
> To: egcs-bugs@egcs.cygnus.com
> Date: Tue, 12 Oct 1999 02:01:36 +0200 (CEST)
> I deperately need new with placement, but gcc-2.95.1 refuses
> to compile it.
Did you read:
18.4 Dynamic memory management [lib.support.dynamic]
1 The header <new> defines several functions that manage the allocation
of dynamic storage in a program. It also defines components for
reporting storage management errors.
Header <new> synopsis
? I thought it was self explanatory. :-) Headers are those pesky
little files that you have to #include to see their functionality...
> But when I try to compile this:
> --------------------------
> class Something {
> };
> char place[sizeof(Something)];
> int main(void)
> {
> Something* p = new (place) Something();
> return 0;
> }
> --------------------------
Not a bug.