|
constexpr | string_literal (std::basic_string_view< CharType > str) |
| 从string_view 构造string_literal 类型
|
|
constexpr | string_literal (const CharType(&value)[Size+1]) |
| 从数组构造string_literal 类型
|
|
constexpr std::size_t | size () const |
| 返回字符串的长度
|
|
constexpr bool | empty () const |
| 判断字符串是否为空字符串
|
|
constexpr CharType & | operator[] (std::size_t sz) |
| 获取下标对应的字符
|
|
constexpr const char & | operator[] (std::size_t sz) const |
| 获取下标对应的字符
|
|
constexpr const CharType * | data () const |
| 返回一个C-style(以'\0'结尾)的字符串指针
|
|
template<std::size_t Size2> |
constexpr bool | operator!= (const string_literal< CharType, Size2 > &other) const |
| 判断两个字符串是否不相等
|
|
template<std::size_t Size2> |
constexpr bool | operator== (const string_literal< CharType, Size2 > &other) const |
| 判断两个字符串是否相等
|
|
template<size_t Size2> |
string_literal< CharType, Size+Size2 > constexpr | operator+ (string_literal< CharType, Size2 > other) const |
| 拼接两个字符串
|
|
template<typename CharType, std::size_t Size>
struct struct_pack::string_literal< CharType, Size >
编译期字符串类型
- 模板参数
-
样例代码:
auto str = struct_pack::get_type_literal<int, int, short>();
CHECK(str.size() == 5);
CHECK(str == val);
编译期字符串类型
Definition struct_pack_doc.hpp:297