https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86954

--- Comment #4 from frankhb1989 at gmail dot com ---
Well, actually I'm not sure if the original implementation has done the right
thing, as I don't find that the standard has requirement to specify that the
replaced definitions must acknowledge the fact nothrow_t overloads should only
be called on the specified condition (... and if so, whether it worth an LWG
issue).

But that still seems suspicious to me, because symmetry of call between
nothrow_t placement ::operator new and ::operator delete does not exist in the
language indeed, so that seems like an unintentional use unless it is
documented elsewhere. On the other hand, the change here towards to a simpler
and undoubtedly conformant way.

BTW, I do know the feature is deprecated in C++17 and removed in C++2a. I read
the paper of deprecation. It is plausible to be removed from the standard, but
not a must - not with a very strong reason. However, I am sure I do need that
feature so I have to reinvent my wheels... as done internally by various
standard library implementations. (More specifically, I need
std::_Temporary_buffer in libstdc++ and MSVC's current <algorithm>
implementation, or at least something equivalent to
std::__return_temporary_buffer in libc++, but surely I can't rely on them
directly.) At least a raw call of allocation function does not always express
the intended call site requirements clearly like std::get_temporary_buffer, so
users who want to make it clear have to afford the extra layer of an
abstraction. Arguably, the removal will bloat work for anyone wants that and
discourage clearer expression of intentions.

Reply via email to