News for hackers. Stuff that matters.
Re:A Usable C++ Dialect That Is Safe Against Memory Corruption by zach43 on Thursday March 15, 2018 @03:09PM (#16595667)
Wouldn't you have a problem with reference cycles in C++ smart pointers? Not sure if they do anything special to prevent this.
Re:A Usable C++ Dialect That Is Safe Against Memory Corruption by nobugs on Friday March 16, 2018 @01:01AM (#16598744)
std::unique_ptr<> won't allow you to have 'owning' reference cycles; neither 'owning' reference cycles are really necessary in real-world programs.
Re:A Usable C++ Dialect That Is Safe Against Memory Corruption by saagarjha on Thursday March 15, 2018 @03:15PM (#16595724)
std::weak_ptr is there for resolving reference cycles.
Re:A Usable C++ Dialect That Is Safe Against Memory Corruption by pdpi on Thursday March 15, 2018 @08:54PM (#16597797)
Which means you have to design around it. You can definitely run into problems with cyclical shared_ptr dependencies
Re:A Usable C++ Dialect That Is Safe Against Memory Corruption by saagarjha on Thursday March 15, 2018 @11:27PM (#16598368)
Well, you have to do this for every language that does reference counting.
Re:A Usable C++ Dialect That Is Safe Against Memory Corruption by pjmlp on Friday March 16, 2018 @04:21AM (#16599322)
Either that, or have a cycle collector in addition to the normal reference counting optimizations.