avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] adding wrapper functions for new and, delete operator


From: John Myers
Subject: Re: [avr-libc-dev] adding wrapper functions for new and, delete operators
Date: Fri, 11 Feb 2011 21:01:35 -0800

> > I would avoid using a header
> > the header compat/c++.h since that would require the programmer to use a
> > #ifdef to switch header files includes if the code is used on different
> > platforms.
>
> Then please suggest a better name ... I'm half-fine with naming it
> just "new", though then make sure that it contains everything that is
> mandated by the C++ standard.  I'm only half-fine with it because it's
> normally GCC's business to install that file, so once G++ has been
> fixed to include real libstdc++ support, this our file will eventually
> collide with the correct one.  That's why I would be more happy with a
> file name like compat/c++.h: it makes it more obvious to the user that
> this is *not* the "real thing" but a workaround, which perhaps might
> need special care (like, it's always being a "nothrow" implementation,
> for example).
>

 The new / delete operators can be put in a different namespace in order to
avoid any name collisions with the new/delete in the std namespace.
the header could still be called new and then just put it in the compat
directory (compat/new) to differentiate it from the standards compliant new
header.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]