2 ms·
new can and does fail when you're out of memory, and this is a condition that many programs do need to handle (for some programs crashing is appropriate and in
by lmm 10y ago
new can and does fail when you're out of memory, and this is a condition that many programs do need to handle (for some programs crashing is appropriate and in that case sure, you can live without exceptions). In a pedantic technical sense that's not the constructor failing, but your options for handling it are much the same.