C++

how can I do to create a generic container class being able to contain any number of strings, signed 32bit integers & doubles?

You already invited:

Amos

Upvotes from: Tom

you could use vector and variant?

std::vector<std::variant<std::string, int32_t, uint32_t, double>>
 
std::any is expensive and if you know the types it is probably not correct

fidel

Upvotes from:

std any is not for cases where you want to actually use the value

If you wanna answer this question please Login or Register