2 ms·
I usually just use switch(std::variant:index()) and then std::get<int>(). Which worked reasonably well. But then I stopped using std::variant altogether, becaus
by danybittel 6y ago
I usually just use switch(std::variant:index()) and then std::get<int>(). Which worked reasonably well. But then I stopped using std::variant altogether, because in the end it never gave enough benefits.
These days I use reinterpret_cast and cast away all my problems.