3 ms·
> It turned out that the std::string empty string reference count was just doing a vanilla ++, no locking, nothing, variable not marked volatile, nothing. The
by kazinator 10y ago
> It turned out that the std::string empty string reference count was just doing a vanilla ++, no locking, nothing, variable not marked volatile, nothing.
The whole implementation is smells of silliness, because there is no need to track how many references there are to a global null string, which need not even be dynamically allocated.
- bluejekyll 10y agoI know; I've often wondered if this was changed, never went back to look.
- daemin 10y agoProbably a few years ago, around C++11 time. Where the standard made it not possible to have a Copy-on-Write implementation of string.