Suppose I have an overload set, like so:
class C
{
public:
static void f(const A &);
static void f(const B &);
};
I'd like to do something like
std::variant<A, B> v;
// ...
std::visit(C::f, v);
but this doesn't compile. Is there some way of taking an overload set and regarding it as, or converting it to, a Visitor?
[](auto&& arg){ C::f(std::forward<decltype(arg)>(arg));}
. Other than that I believe this is the cleanest solution there is because overload sets simply cannot be passed around. – Gomphosis