News for hackers. Stuff that matters.
Re:Immutable.rs: immutable data structures for Rust by slavik81 on Friday April 06, 2018 @10:36PM (#16779101)
That's exactly what the Qt collections do:

> Implicit sharing automatically detaches the object from a shared block if the object is about to change and the reference count is greater than one. (This is often called copy-on-write or value semantics.) [source: http://doc.qt.io/qt-5/implicit-sharing.html]

The C++ language is sometimes a little cruel, though. It's easy to accidentally call the mutable version of a function when the const version would have been sufficient. That can be a performance problem if it causes unnecessary copies.

There are no comments on this comment yet.