On Montag, 26. Februar 2018 02:33:58 CET Thiago Macieira wrote: > > [Sidenote: There's a reason the C++-standard disallows reference counting > > for its string class.] > > There is, but this isn't it. The concern is the unexpected memory allocation > when calling a non-const function. The standard banned reference counting > by requiring a few of those functions to have constant time (O(1)) > operation, which can't be implemented if you need to allocate memory and > memcpy.
That's how they do it, but certainly not the only reason why they do it. There are also concerns about thread safety and - I'm quite sure - code optimization. But this should be of no concern to us - since we don't use std::string. Berthold _______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface