Like std::string
, but for compile-time use.
More...
#include <String.hpp>
Public Member Functions | |
constexpr | String (char c) |
constexpr | String (const char *other) |
constexpr | String (int n) |
Format an integer as a string in base-10. More... | |
constexpr bool | operator== (const String &rhs) const |
constexpr bool | operator!= (const String &rhs) const |
constexpr String & | operator+= (const String &rhs) |
constexpr String | operator+ (const String &rhs) const |
constexpr void | truncate (int n) |
Delete n characters from the end. More... | |
constexpr String & | operator<< (const String &rhs) |
Stream-like operator to append to the string. More... | |
constexpr Char & | operator[] (int i) |
constexpr const Char & | operator[] (int i) const |
constexpr bool | empty () const |
constexpr int | size () const |
Like std::string
, but for compile-time use.
sp::c
namespace, this cannot be used at runtime.Char | The character type. The default is char. Must be default constexpr constructible and constexpr copyable or a fundamental data type. |
Log2MaxSize | The maximum size of the string expressed as a log base 2. The default is 31 (enough for about 2 billion characters). The maximum size of the string is 2^Log2MaxSize - 1. This template parameter is useful to limit the address space used by the container (e.g: to nest containers). |
|
constexpr |
Format an integer as a string in base-10.
|
constexpr |
Stream-like operator to append to the string.
This is useful for building strings by concatenation.
|
constexpr |
Delete n
characters from the end.