Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: C++ and operator new() Message-ID: <55828@microsoft.UUCP> Date: 13 Jul 90 23:02:58 GMT References: <1155@uvicctr.UVic.CA.UUCP> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 16 In article <1155@uvicctr.UVic.CA.UUCP> mjunkin@uvicctr.UUCP (Michael Junkin) writes: ... >The intent is that > X *x = new X(...); (1) >can be used to allocate and construct local objects while > X *x = ::new X(...); (2) >is used to allocate and construct global objects of class X. ... > static void *operator new(size_t); Interesting. I tried your example on the compiler I've been playing with, and it wouldn't accept the static keyword on operator new, even though E&S implies such use is permissible, but unnecessary. Leaving off "static," my compiler then acts as you would like. Sounds to me like one bug each in two compilers.