2 ms·
Actually in C++ the vast majority of the time, the right thing to do is Foo foo{args}; Which is simpler than the other cases, more correct and more perfor
by jcelerier 5y ago
Actually in C++ the vast majority of the time, the right thing to do is
Foo foo{args};
Which is simpler than the other cases, more correct and more performant. The rare few times dynamic allocation of something that is not an array with new is needed is when you have polymorphic types - but then, the user code generally calls a factory function instead of new.