Boost logo

Boost :

Subject: Re: [boost] [variant] match()
From: Peter Dimov (lists_at_[hidden])
Date: 2015-01-07 13:48:46


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'. :-)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk