Is std::string
reference-counted when using gcc 4 with -std=c++0x
or -std=c++11
?
Adding some useful information that post-dates this question.
std::string
will no longer be reference-counted with the release of GCC 5, to address this C++11 requirement.
From https://gcc.gnu.org/gcc-5/changes.html
A new implementation of std::string is enabled by default, using the small string optimization instead of copy-on-write reference counting.