Is std::string ref-counted in GCC 4.x / C++11?
Looking at libstdc++ documentation I find (see the link for more info): A string looks like this: [_Rep] _M_length [basic_string<char>] _M_capacity _M_dataplus _M_refcount _M_p —————-> unnamed array of char_type So, yes it is ref counted. Also, from the discussion here: Yes, std::string will be made non-reference counting at some point, but as a non-reference-counted string … Read more