std::meta::is_annotation
From cppreference.com
| Defined in header <meta>
|
||
consteval bool is_annotation( std::meta::info r );
|
(since C++26) | |
Returns true if r represents an annotation. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r represents an annotation; otherwise false.
Example
Run this code
#include <meta>
[[=1]] int x;
static_assert(!is_annotation(^^x));
constexpr std::meta::info ann{std::meta::annotations_of(^^x)[0]};
static_assert(is_annotation(ann) and [:::std::meta::constant_of(ann):] == 1);
int main() {}
See also
(C++26) |
obtains the annotations applying to the reflected entity (function) |
(C++26) |
obtains the annotations that apply to the reflected entity and have the specified type (function) |