ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
TT_StringConstants< TChar > Struct Template Reference

Description:

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

DOXYGEN.

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
Zero-terminated constants are given with the inclusion of header alib/strings/cstring.hpp.
See also the manual chapter 6.3 String Constants.
Template Parameters
TCharThe character type.

Definition at line 2512 of file string.hpp.

#include <string.hpp>

Public Static Method Index:

static constexpr String< TChar > EmptyString ()
 

Method Details:

◆ EmptyString()

template<typename TChar >
static constexpr String< TChar > EmptyString ( )
staticconstexpr
Returns
An empty string.

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