VLink  2.0.0
A high-performance communication middleware
vlink::NameDetector 命名空间参考

Compile-time type-name and enum-name reflection primitives. 更多...

命名空间

 
 

函数

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.

模板参数
TypeTType 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.

模板参数
EnumTEnumeration type, deduced from value.
参数
valueEnumerator 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.

模板参数
TypeTType whose support status is queried.
返回
true when get<TypeT>() returns a meaningful non-empty view on this compiler.