Folly fbstring has the same trick, and it&#x27;s a std::string compliant implementation used in production at Facebook.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;folly&#x2F;blob&#x2F;master&#x2F;folly&#x2F;docs&#x2F;FBString.md#storage-strategies" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;folly&#x2F;blob&#x2F;master&#x2F;folly&#x2F;docs&#x2F;FBS...</a>