I found out that std :: variant exists in C ++ 17. It seems that there are no predefined data types supported by the variant container, but for each variant type the user can define his own set of data types.
std::variant<int, float> v;
I wonder how long can a list of types be? Does the library have predefined templates for the maximum number of parameters in the Alexandrescu method or an option supported by the compiler, and the number of types is not limited?
source
share