DEV Community

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

Collapse
 
pgradot profile image
Pierre Gradot • Edited

From what I understand, you want a type that can hold several possible types. This is a union in C/C++.

From C++17, you can use en.cppreference.com/w/cpp/utility/...

Define you own variant type that can hold any kind of tokens you want to handle. Them process variables of this variant type.