[Example 1: #include<new>[[nodiscard]]void*operatornew(std::size_t size, void* ptr)noexcept{returnnullptr; // undefined behavior, should return non-null pointer} — end example]
[Example 2: #include<new>struct A {int x;
};
int main(){char*p =nullptr;
A *a =new(p) A; // undefined behavior, non-allocating new returning nullptr} — end example]