Compile-time type-name and enum-name reflection primitives.
更多...
|
| | customize |
| | Customisation points overriding the default enumerator scanning window.
|
| |
| | detail |
| |
|
| template<typename TypeT > |
| constexpr bool | is_support () noexcept |
| | Reports whether the current toolchain can extract a textual name for TypeT. 更多...
|
| |
| template<typename TypeT > |
| constexpr std::string_view | get () noexcept |
| | Returns the trimmed compile-time identifier for TypeT. 更多...
|
| |
| template<typename EnumT > |
| constexpr std::string_view | get_enum (EnumT value) noexcept |
| | Resolves the source identifier of an enumerator literal at compile time. 更多...
|
| |
Compile-time type-name and enum-name reflection primitives.
Details
◆ get()
template<typename TypeT >
| constexpr std::string_view vlink::NameDetector::get |
( |
| ) |
|
|
inlineconstexprnoexcept |
Returns the trimmed compile-time identifier for TypeT.
MSVC inserts a "struct " or "class " prefix into FUNCSIG; both are stripped before the value is returned so the same textual identifier is produced on every supported toolchain. The returned view always points at static read-only storage.
- 模板参数
-
| TypeT | Type whose identifier is requested. |
- 返回
- Read-only
std::string_view with the resolved identifier.
◆ get_enum()
template<typename EnumT >
| constexpr std::string_view vlink::NameDetector::get_enum |
( |
EnumT |
value | ) |
|
|
inlineconstexprnoexcept |
Resolves the source identifier of an enumerator literal at compile time.
- 模板参数
-
| EnumT | Enumeration type, deduced from value. |
- 参数
-
| value | Enumerator value whose label is requested. |
- 返回
- Identifier text, or an empty view when
value is outside the configured scanning window or is not a named enumerator.
◆ is_support()
template<typename TypeT >
| constexpr bool vlink::NameDetector::is_support |
( |
| ) |
|
|
inlineconstexprnoexcept |
Reports whether the current toolchain can extract a textual name for TypeT.
- 模板参数
-
| TypeT | Type whose support status is queried. |
- 返回
true when get<TypeT>() returns a meaningful non-empty view on this compiler.