std::meta::has_default_member_initializer
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
#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) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/meta/has_default_member_initializer