No doubt that std::visit appears to be a mess but why not call std::get<a_type>(a_variant) and trap bad_variant_access exceptions? It would still be a bit annoying to exception-wrap each attempt but it seems cleaner than any of the std::visit alternatives.