Is there a way to directly get the default value for a member that was defined using initialization in the class? For instance:
struct Test
{
int someValue = 5;
};
int main(int argc,char *argv[])
{
auto val = declvalue(Test::someValue);
std::cout<<val<<std::endl;
for(;;);
return 0;
}
Basically something that "copies" (like decltype) the entire declaration, including the default value. Is there something similar?
source
share