|
VLink 2.0.0
A high-performance communication middleware
|
Compile-time type-trait utilities used internally by VLink. More...
#include <atomic>#include <memory>#include <type_traits>Go to the source code of this file.
Namespaces | |
| namespace | vlink |
| namespace | vlink::Traits |
| Collection of compile-time type-trait helpers for VLink. | |
Macros | |
| #define | VLINK_HAS_MEMBER(T, member) |
| Macro Definitions. | |
Compile-time type-trait utilities used internally by VLink.
The vlink::Traits namespace collects a set of small, self-contained template meta-programming helpers that are used throughout the VLink codebase to detect type properties at compile time. They follow the same conventions as the C++ standard library <type_traits> header.
All helpers are either:
std::true_type / std::false_type, orconstexpr functions returning bool.| Helper | Description |
|---|---|
| EmptyType | An empty tag type used as a placeholder |
| ExpectFalse | Always evaluates to std::false_type (useful in static_assert) |
| Callable | Detects whether T is callable with no arguments |
| Assignable | Detects whether OT is assignable from T |
| EqualityComparable | Detects whether OT supports == with T |
| GreaterComparable | Detects whether OT supports < and > with T |
| Operatorable | Detects whether OT supports << and >> stream operators with T |
| IsAtomic | Detects whether T is a std::atomic specialization |
| IsSharedPtr | Detects whether T is a std::shared_ptr specialization |
| RemoveSharedPtr | Strips the std::shared_ptr wrapper to obtain the element type |
| has_member | Runtime-style SFINAE check for a named member |
| is_non_char_ptr | True when T decays to a non-char pointer |
| is_integer | True for integer types excluding bool, char, and signed/unsigned char |
| is_floating | True for floating-point types |
vlink::Traits namespace (note the capital T). VLINK_HAS_MEMBER is the corresponding macro wrapper for has_member.| #define VLINK_HAS_MEMBER | ( | T, | |
| member ) |
Macro Definitions.
Checks at compile time whether type T has an accessible member named member.
Expands to a constexpr boolean expression (true/false) evaluated at compile time. Internally delegates to vlink::Traits::has_member.
| T | The type to inspect. |
| member | The unquoted member name to look for. |