Код: Выделить всё
#include
#include
#include
struct TestNew {
void* operator new(std::size_t, std::nothrow_t) noexcept { // Doesn't call the constructor
// void* operator new(std::size_t, std::nothrow_t) { // Unexpected call to constructor
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79736602/unexpected-call-to-constructor-when-non-throwing-operator-new-returns-a-nullptr[/url]
Мобильная версия