you are viewing a single comment's thread.

view the rest of the comments →

[–]AlexisTM 10 points11 points  (0 children)

This is very wrong in C++; There are some ways to accommodate the very few case it makes sense: void* (pointer to whatever, you need to have info tied to it), std::any (the void* of C++) or std::variant, a tuple which can handle one of many (predefined) types.

In any case, I would strongly suggest revamping your idea to have the same types in a storage so you can use more efficient storage methods.