3 ms·
The "best default" way of instantiating is Foo foo(args); Sometimes an object has to be on the heap as its own separate allocation (rather than on the sta
by not2b 5y ago
The "best default" way of instantiating is
Foo foo(args);
Sometimes an object has to be on the heap as its own separate allocation (rather than on the stack or as a data member), but I notice that some new developers who come to C++ from some other language use the heap way too much.