Files
2025-10-25 03:02:53 +03:00

36 lines
998 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[meta.string.literal]
# 21 Metaprogramming library [[meta]](./#meta)
## 21.4 Reflection [[meta.reflection]](meta.reflection#meta.string.literal)
### 21.4.2 Checking string literals [meta.string.literal]
[🔗](#lib:is_string_literal)
`consteval bool is_string_literal(const char* p);
consteval bool is_string_literal(const wchar_t* p);
consteval bool is_string_literal(const char8_t* p);
consteval bool is_string_literal(const char16_t* p);
consteval bool is_string_literal(const char32_t* p);
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/meta.tex#L3350)
*Returns*:
- [(1.1)](#1.1)
If p points to an unspecified object ([[expr.const]](expr.const "7.7Constant expressions")), false[.](#1.1.sentence-1)
- [(1.2)](#1.2)
Otherwise, if p points to a subobject
of a string literal object ([[lex.string]](lex.string "5.13.5String literals")), true[.](#1.2.sentence-1)
- [(1.3)](#1.3)
Otherwise, false[.](#1.3.sentence-1)