class final
CStringCompact, deduplicating string variant for constant strings.
Public static functions
-
static auto lookup(const std::
string& s) → CString
Public functions
-
auto assign(const std::
string& s) → CString& noexcept -
auto string() const → const std::
string& - Convert
CString
into a std::string.
Function documentation
static CString Ase:: CString:: lookup(const std:: string& s)
Lookup a previously existing CString for a std::s
. If s
has never been assigned to a CString before, the returned CString is empty. In constrast to assign(), no new memory is allocated.
CString& Ase:: CString:: assign(const std:: string& s) noexcept
Assign a std::s
, memory is allocated if needed. Note that CString::assign() is not particularly fast, use it only to save memory for strings that are known to persist throughout runtime.