#include <iostream>
using namespace std;
int main() {
try {
auto a = new int[1ul<<60];
std::cout << "Allocated at " << std::hex << a << std::endl;
delete[] a;
} catch(const std::bad_alloc&) {
std::cout << "Exception" << std::endl;
}
std::cout << "Nothrow: " << new(std::nothrow) int[1ul<<60] << std::endl;
auto a = new(std::nothrow) int;
std::cout << "Allocated at " << a << std::endl;
delete a;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cgl0cnkgewoJCWF1dG8gYSA9IG5ldyBpbnRbMXVsPDw2MF07CgkJc3RkOjpjb3V0IDw8ICJBbGxvY2F0ZWQgYXQgIiA8PCBzdGQ6OmhleCA8PCBhIDw8IHN0ZDo6ZW5kbDsKCQlkZWxldGVbXSBhOwoJfSBjYXRjaChjb25zdCBzdGQ6OmJhZF9hbGxvYyYpIHsKCQlzdGQ6OmNvdXQgPDwgIkV4Y2VwdGlvbiIgPDwgc3RkOjplbmRsOwoJfQoJCglzdGQ6OmNvdXQgPDwgIk5vdGhyb3c6ICIgPDwgbmV3KHN0ZDo6bm90aHJvdykgaW50WzF1bDw8NjBdIDw8IHN0ZDo6ZW5kbDsKCQoJYXV0byBhID0gbmV3KHN0ZDo6bm90aHJvdykgaW50OwoJc3RkOjpjb3V0IDw8ICJBbGxvY2F0ZWQgYXQgIiA8PCBhIDw8IHN0ZDo6ZW5kbDsKCWRlbGV0ZSBhOwoJcmV0dXJuIDA7Cn0=