News for hackers. Stuff that matters.
Re:C++ Papercuts by alexvitkov on Monday August 28, 2023 @10:31AM (#37294621)
If references were guarenteed sane and consistent values like in Rust, sure - but it's trivial to get a bogus reference in C++, so I don't buy the type safety thing. An assert actually catches errors, a reference just declares intent.

As for smart pointers there's a lot of domains with tight performance requirements where you can't afford them - and to be quite frank, if you can afford to use shared_ptr you can also afford GC, so just use a sane language

Re:C++ Papercuts by ninkendo on Tuesday August 29, 2023 @08:32AM (#37306780)
> but it's trivial to get a bogus reference in C++

How? Honestly curious. (You can certainly reinterpret_cast something and ignore all warnings, but is that all?)

Re:C++ Papercuts by showdead on Wednesday August 30, 2023 @03:38PM (#37327808)