Re: Additional Glib::RefPtr Safety Mechanism

Jonathan Wakely via gtkmm-list <[email protected]>
Newsgroups gmane.comp.gnome.gtkmm
Message-ID <CAJcCCPPT3Py9fJ4F93OUQ_5SeqsumzM-Cczquycoi3DGTzKqmg@mail.gmail.com>
On Sat, 31 Aug 2019, 11:55 Karsten Pedersen, <[email protected]> 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
> necessary.
>

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.

_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.