4 ms·
But you have exactly the same options in C++.
by gpderetta 5y ago
But you have exactly the same options in C++.
- masklinn 5y agoReally? What's the factory function invoked for a copy or a move?
- gpderetta 5y agoWhatever you want it to be. By default of the compiler will generate calls to move and copy constructors.
- mikepurvis 5y agoSure, but the point is that providing factories requires extra work and consideration, so a lot of C++ classes instead lean on the default option of a constructor. Rust's removal of that forces the class designer to choose.