Using std::visit in parallel with std::variant, does it give a better performance in comparison with dynamic inheritance using virtual?
Based on cppreference there is the following statement
On typical implementations, the time complexity of the invocation of vis can be considered equal to that of access to an element in an (possibly multidimensional) array or execution of a switch statement.
Does it depend on the number of types are kept in variant?
2