std::meta::has_default_member_initializer
From cppreference.com
| Defined in header <meta>
|
||
consteval bool has_default_member_initializer( std::meta::info r );
|
(since C++26) | |
Returns true if r represents a non-static data member that has a default member initializer. Otherwise returns false.
Parameters
| r | - | a reflection value |
Return value
true if r has a default member initializer; otherwise false.
Example
Run this code
#include <meta>
struct S
{
int a;
double b{0.0};
};
static_assert(!has_default_member_initializer(^^S::a));
static_assert(has_default_member_initializer(^^S::b));
int main() {}
See also
(C++26) |
checks if reflection represents a non-static data member (function) |