I am new to C++. I read very frequently from some sites that variant member?.
class School
{
int x; -> data member.
}
I know data member
The term variant is usually employed to identify a member that can hold a value of a set of different types. Similar to a union
in the language, the term variant
is usually reserved for types that allow the storage of the different options in a type safe way.
You might want to read over the documentation of the boost variant library for one such example, and if that does not clear up the concept, drop a comment/create a question with your doubts.
Boost Variant