3 ms·
> Well, that entirely depends on your skill and your overall design. If your argument against std::move & unique_ptr is "I don't make mistakes" then your ego i
by kllrnohj 7y ago
> Well, that entirely depends on your skill and your overall design.
If your argument against std::move & unique_ptr is "I don't make mistakes" then your ego is vastly too large to be a C++ developer.
The design doesn't change. unique_ptr just solidifies the design such that the compiler can help enforce the design.
> But again, there's still vector<shared_ptr<SomeThing>> to the rescue if we need it.
If you want to insist all heap allocates are always shared_ptr you can certainly do that. Personally I'd consider that dreadfully slow & expensive, and at that point you're far, far better off just using a GC'd language instead.
> I said if you require std::move in a certain situation, have another look at your overall design.
std::unique_ptr single handily proves this wrong.
- rsp1984 7y ago> If your argument against std::move & unique_ptr is "I don't make mistakes" then your ego is vastly too large to be a C++ developer. Please stop the strawmans and polemics and allow your ego to consider the opinion of someone who is, in all likelihood, more experienced in shipping product written in C++. > If you want to insist all heap allocates are always shared_ptr you can certainly do that. Personally I'd consider that dreadfully slow & expensive Oh well. I have a feeling we're not going to agree. Maybe let's discuss again in a few years. Maybe I'll have tried std::move then and found that it is somewhat useful in certain special situations. And maybe you'll have realized that the "dreadfully slow & expensive" shared_ptr doesn't make a difference in terms of end product quality in, I'd wager to say, 99.99% of situations. > at that point you're far, far better off just using a GC'd language instead. Uuhhm, no.