3 ms·
You can have allocation-less empty std::string even without SSO. The empty string simply uses a statically allocated shared buffer. That's what libstdc++ did i
by gpderetta 2y ago
You can have allocation-less empty std::string even without SSO. The empty string simply uses a statically allocated shared buffer.
That's what libstdc++ did in its old refcounted variant, for example.
And no, you don't need refcounting.