3 ms·
std::unique_ptr and std::shared_ptr are templated wrapper classes.
by ben-schaaf 4y ago
std::unique_ptr and std::shared_ptr are templated wrapper classes.
- Night_Thastus 4y agoOh. I misunderstood. I was thinking of user-made templates, not the built-in ones from the standard library. I don't see the issue though. Something like vector feels intuitive. I have a vector<int> or a vector<myType> etc. A pointer to an int, a unique_ptr<int>. It's convenient and fairly flexible. I don't really see the downside, or how it could be done better given static typing.