Re: Additional Glib::RefPtr Safety Mechanism

On Sat, 31 Aug 2019, 11:55 Karsten Pedersen, <kpedersen gmx com> wrote:
I have yet to see it in any gtkmm code (you will be pleased to hear)
but my personal opinion is that it is surely a nice idea to attempt
to make C++ 100% safe rather than having to rely purely on the skills of
a developer. This is generally the trend in Rust communities but it
seems the culture in C++ communities is that not all safety is

With Rust that safety is checked and enforced by the language and the compiler. The language rules mean that most checking can have no overhead at runtime. Your solution incurs non-zero runtime cost (extra reference counting) which can't be optimised away in general.

Being 100% safe would be nice, but there's a trade off. Achieving it in C++ is either impossible or very expensive. I don't agree that "it is surely a nice idea to attempt to make C++ 100% safe". It's unrealistic to pretend otherwise.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]