On Saturday, 13 September 2014 at 12:05:59 UTC, po wrote:
Smart pointers are rarely used, most C++ stuff is done by value.

Strings too?

 Two string types are used.

-std::string type: by value, has smaller buffer optimization, used at startup/logging, and for any dynamic strings with unbounded possible values

Are you sure? From basic_string.h:

        _CharT*
        _M_refcopy() throw()
        {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
          if (__builtin_expect(this != &_S_empty_rep(), false))
#endif
__gnu_cxx::__atomic_add_dispatch(&this->_M_refcount, 1);
          return _M_refdata();
        }  // XXX MT

Reply via email to