ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::strings::StringConstantsTraits< TChar > Struct Template Reference

Description:

template<typename TChar>
struct alib::strings::StringConstantsTraits< TChar >

This template class has three specializations for types nchar, wchar, and xchar, which each provides the static method EmptyString. (The only non-zero-terminated string-constant needed/supported by ALib.)

The class is useful to implement methods that are templated with the character type they use and that are in need of an empty string instance.

In non-templated code (that works with fixed or logical character sizes), the following constexpr namespace constants are rather to be used: EMPTY_STRING, EMPTY_COMPLEMENT_STRING, EMPTY_STRANGE_STRING, EMPTY_NSTRING, EMPTY_WSTRING, and EMPTY_XSTRING.

Nulled strings are not defined here, as they any time can be constructed using nullptr. To improve readability, constexpr namespace variable are given with NULL_STRING, NULL_COMPLEMENT_STRING, NULL_STRANGE_STRING, NULL_NSTRING, NULL_WSTRING, and NULL_XSTRING.

See also
Manual chapter 6.3 String Constants.
Template Parameters
TCharThe character type.

Definition at line 2427 of file string.inl.

Public Static Method Index:

static constexpr String< TChar > EmptyString ()
 

Method Details:

◆ EmptyString()

template<typename TChar>
constexpr String< TChar > alib::strings::StringConstantsTraits< TChar >::EmptyString ( )
staticconstexpr
Returns
An empty string.

The documentation for this struct was generated from the following file: