Trying to get more familiar with C++17, I've just noticed std::visit
:
template <class Visitor, class... Variants>
constexpr /*something*/ visit(Visitor&& vis, Variants&&... vars);
Why does std::visit
not take a single variant, but rather any number of variants? I mean, you can always take some standard library function and have it take multiple parameters with the same role, working on all of them (e.g. std::find()
for multiple elements in a container); or you could be taking multiple visitors and using them on the same variant.
So, why this specific 'variadification'?
std::visit
to be the way it is by reading your answer, but you're kind of assuming I know the answer already. See my suggested answer below... – Catholicism