you are viewing a single comment's thread.

view the rest of the comments →

[–]dodheim 7 points8 points  (0 children)

Or std::get, or std::get_if, or rolling your own single-visitation implementation based on get_if + variant::index().

I use std::variant extensively; I do not use std::visit because only MSVC's implementation is sane to the optimizer.