You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The library provides default definitions for the global allocation and
deallocation functions. Some global allocation and deallocation
functions are replaceable\iref{new.delete};
these are attached to the global module\iref{module.unit}.
A \Cpp{} program shall
provide at most one definition of a replaceable allocation or
deallocation function. Any such function definition replaces the default
version provided in the library\iref{replacement.functions}. The
following allocation and deallocation functions\iref{support.dynamic}
are implicitly declared in global scope in each translation unit of a
program.
[[nodiscard]] void* operator new(std::size_t);
[[nodiscard]] void* operator new(std::size_t, std::align_val_t);
void operator delete(void*) noexcept;
void operator delete(void*, std::size_t) noexcept;
void operator delete(void*, std::align_val_t) noexcept;
void operator delete(void*, std::size_t, std::align_val_t) noexcept;
[[nodiscard]] void* operator new[](std::size_t);
[[nodiscard]] void* operator new[](std::size_t, std::align_val_t);
void operator delete[](void*) noexcept;
void operator delete[](void*, std::size_t) noexcept;
void operator delete[](void*, std::align_val_t) noexcept;
void operator delete[](void*, std::size_t, std::align_val_t) noexcept;
My confusion is that:
Some global allocation and deallocation
functions are replaceable\iref{new.delete};
these are attached to the global module\iref{module.unit}.
The
following allocation and deallocation functions\iref{support.dynamic}
are implicitly declared in global scope in each translation unit of a
program.
But from the paragraph itself we can't tell if the following allocation and deallocation functions are the replaceable functions or not. So that we can't make sure the following allocation and deallocation functions should be attached to the global module fragment or not from the wording. Although later I checked http://eel.is/c++draft/new.delete carefully to make sure that all of these functions should be attached to the global module fragment, I still feel like the paragraph is hard to read.
I suggest to add a replaceable to the last sentence to make it as:
The
following replaceable allocation and deallocation functions\iref{support.dynamic}
are implicitly declared in global scope in each translation unit of a
program.
So that it would be pretty clear these functions should be attached to the global module fragment at the first sight.
The text was updated successfully, but these errors were encountered:
The [basic.stc.dynamic.general]p2 tells
My confusion is that:
functions are replaceable\iref{new.delete};
these are attached to the global module\iref{module.unit}.
following allocation and deallocation functions\iref{support.dynamic}
are implicitly declared in global scope in each translation unit of a
program.
But from the paragraph itself we can't tell if
the following allocation and deallocation functions
are the replaceable functions or not. So that we can't make surethe following allocation and deallocation functions
should be attached to the global module fragment or not from the wording. Although later I checked http://eel.is/c++draft/new.delete carefully to make sure that all of these functions should be attached to the global module fragment, I still feel like the paragraph is hard to read.I suggest to add a
replaceable
to the last sentence to make it as:So that it would be pretty clear these functions should be attached to the global module fragment at the first sight.
The text was updated successfully, but these errors were encountered: