Re:Rust: A Critical Retrospective
by ben-schaaf on Thursday May 19, 2022 @02:25PM
(#31438263)
std::unique_ptr and std::shared_ptr are templated wrapper classes.
[ Parent
| on HN ]
Re:Rust: A Critical Retrospective
by Night_Thastus on Thursday May 19, 2022 @03:04PM
(#31438718)
Oh. 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.