News for hackers. Stuff that matters.
Re:Rust: A Critical Retrospective by Night_Thastus on Thursday May 19, 2022 @11:44AM (#31436187)
For what purpose would you need to wrap everything in a template class? In my work, I've only touched templates a couple of times in years. They're useful, but I don't see how it's always needed.
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.
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.