DEV Community

Discussion on: Is there a way to have raw-types in (modern) C++?

Collapse
 
baenencalin profile image
Calin Baenen

Is there any way I can store a value with a type in the token, so that I can store additional info?
I did think of void*, and nullptr as default values. But that doesn't solve my problem of needed a raw type (unless I want all the data to be untraceable).

Collapse
 
baenencalin profile image
Calin Baenen

By untraceable, I mean if I have void* value, it'd be impossible to get the origin-type of the pointer back.
Plus, this is also bad, because that means all the information has to be a pointer, which could lead to many (dangling) bugs.