2 ms·
I think you misunderstood the solution. You still want constructors for safety during allocation. You just want to move non-allocation tasks out of the constr
by jayd16 4y ago
I think you misunderstood the solution. You still want constructors for safety during allocation. You just want to move non-allocation tasks out of the constructor because it adds some complexity to initializing instances that doesn't need to be there.
Figuring out what to pass a constructor and the actual allocation are different tasks. The anti pattern is conflating them. It's fine to use constructors.