3 ms·
While I agree C++ is very verbose, I would argue that modern C++ reduces the amount of code you need to write. The full code above should be : foo* x = new foo(
by TheFlash 4y ago
While I agree C++ is very verbose, I would argue that modern C++ reduces the amount of code you need to write. The full code above should be :
foo* x = new foo();
if (x != nullptr) {
...
}
delete x;
and the equivalent modern C++:
auto x = std::make_shared<x>();
...