How to use variant in Unreal Engine
There is a std::variant class template in the standard library that is essentially a type-safe union. It is generally used when we are not sure in advance which object should be populated from our list of object types, so we assume that one of the specified objects must be there at a time. Unreal Engine has an alternative implementation called TVariant that works the same, except that all the types in the declaring template parameter pack must be unique....