7 Jan
2015
7 Jan
'15
6:48 p.m.
Matt Calabrese wrote:
The main limitation of this approach is that overloads must copy/move the passed-in function objects. I.E. there is no known tie_overloads that would be able to exhibit the same behavior.
Hmm. If you had a reference_wrapper<F> which SFINAEd its operator() on whether F::operator() compiles, could you not then pack those reference wrappers into an overloads object? And on another note, even if we had the overloads() function template, it would still make sense to me to have something like match( ... ) that is just an alias for apply_visitor( overloads( ... ) ). I would even make it a member, in which case it would probably be more properly called 'apply'. :-)