3 ms·
> Virtual vs static polymorphism > std::visit over std::variant<A, B, C> is lowered to a switch over the active alternative. > In this case, layout is probabl
by mike_hock 3mo ago
> Virtual vs static polymorphism
> std::visit over std::variant<A, B, C> is lowered to a switch over the active alternative.
> In this case, layout is probably doing more work than the dispatch mechanism itself.
Very likely because last time I checked visit lowers to a virtual call.