News for hackers. Stuff that matters.
Re:Programming in Rust: the good, the bad, the ugly by GolDDranks on Wednesday March 13, 2019 @03:14AM (#19376423)
That needs a garbage collector to work – the lifetime of String isn't limited, but the lifetime &str's is. That means that the backing storage of String can be deallocated under it's feet. There has been some discussion about allowing Strings to use COW in case of &'static str which doesn't have this problem, but I'm not sure whether that proposal has any momentum at the moment.
Re:Programming in Rust: the good, the bad, the ugly by pjmlp on Wednesday March 13, 2019 @03:34AM (#19376515)
In C++ using COW for std::string was a common implementation approach, before C++11 made it invalid.