3 ms·
Variant uses a compile time jump table when you use std::visit afaik.
by en4bz 8y ago
Variant uses a compile time jump table when you use std::visit afaik.
- dkersten 8y agoIt looks like it essentially uses function overloading (multiple overloads of operator()) to do it. Since function overloading compiles to a call of a single function, based on the argument types, this results in a single runtime call. Nice trick!