Assuming a C++14 or C++17 compliant compiler, what is the (approximate, neglecting the exact addresses) output of this program?
No cheating! Say what you believe it is without consulting the standard for 30 minutes, and without compiling and running the program.
#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cassert>
void* operator new ( std::size_t sz ) { printf("alloc size %u\n", sz); return malloc(sz); }
void operator delete( void* ptr, std::size_t sz ) noexcept { printf("delete size %u\n", sz); free(ptr); }
void operator delete( void* ) noexcept { assert(0); }
int main()
{
volatile int* x[5] = {};
for(auto& y : x) y = new int(0);
for(auto& y : x) printf("%d @ %p\n", *y, y);
for(auto& y : x) delete y;
puts("exit");
return 0;
}