Boost Variant: how to get currently held type?
v.which() will return the 0-based index of the type of the object currently held. When you are retrieving the object your code must use a static type (in order to satisfy the get<T> function template) to refer to an (effectively) dynamically typed object. You need to either test for the type (using which() or type()) … Read more