5 ms·
Full disclosure: I'm the blog author. If you're claiming that the verbose way is just writing out the special functions, then I can assure you that it is not e
by quicknir 11y ago
Full disclosure: I'm the blog author.
If you're claiming that the verbose way is just writing out the special functions, then I can assure you that it is not easier to maintain. If you are saying that the class in question could simply write a nested class that wrapped unique_ptr and had the correct copying behavior, maybe, there are arguments for both.
This example is fully intended to be solid code for production use, not primarily to be "clever".
- fsloth 11y agoHi! I have nothing against the pure technical aspects of your article. I originally answered to the poster who said this was a good example why Rust was better and my analysis was written from that point of view. To me this was a poor comparison in the general sense since one can write production C++ using just copy-by-value, RAII semantics and stl containers and handling exceptions by letting the program terminate. "If you're claiming that the verbose way is just writing out the special functions, then I can assure you that it is not easier to maintain." I suppose I found this example lacking in the comparison-to-rust sense precisely because it invented this complected system that needed patching over. While real life systems often evolve through neglect and haste into piles of spaghetti this cannot be used as a direct evidence against a specific language in particular since it is more of a psychological and organizational rather than a language problem.