bug in new.h?

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Tue Nov 30 23:39:00 GMT 1999


>  > I look at the draft C++ standard, here:
>  >      http://www.cygnus.com:80/misc/wp/draft/lib-support.html#lib.new.delete
>  > 
>  > And it says (of dyadic operator new):
>  >      a  C++  program  may  define a function with this function signature
>  >      that displaces the default  version  defined  by  the  C++  Standard
>  >      library.
>  > 
>  > So this library doesn't conform to the standard.  Not a bug?

Not a bug, the library conforms to the standard. Looking at ISO/IEC
14882:1998(E) (which is essentially the same as the draft cited above
in this aspect), I see 18.4.1.3, [lib.new.delete.placement]/1

# These functions are reserved, a C++ program may not define functions
# that displace the versions in the Standard C++ library (17.4.3).
#
#     void* operator new(std::size_t size, void* ptr) throw();

I don't know which dyadic variant of operator new you were originally
looking at; perhaps the 'nothrow' version? This is different from the
placement version.

Regards,
Martin



More information about the Gcc-bugs mailing list