3 ms·
Nitpick: if (x < 100) throw new Exception("Weird!); // LEAK! You shouldn't use `new` either when throwing exceptions. Just: if (x < 100) throw Except
by pyrtsa 13y ago
Nitpick:
if (x < 100) throw new Exception("Weird!); // LEAK!
You shouldn't use `new` either when throwing exceptions. Just:
if (x < 100) throw Exception("Weird!); // no leak.
- Sharlin 13y agoThe grandparent's code is Java, not C++.