Subject: Re: [boost] An open typeswitch using lambdas
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2013-11-30 12:46:23
On Sat, Nov 30, 2013 at 5:11 AM, Mathias Gaunard <
> AFAIK variant doesn't require that your visitors inherit from
>> static_visitor, just that they define the result_type typedef.
Well, whatever the current requirement is specified as, it would be nice if
this utility met that requirement. Being able to easily write variant
visitors at the call-site is very useful. Getting a reasonable, deduced
return type should be easy with decltype and common_type (really,
apply_visitor should probably do this if it hasn't been updated to do so
already, using the explicit result_type instead only if it is specified,
and allowing the return type to be an explicit template argument to
apply_visitor). Anything that makes variants easier to use is a great
addition to boost, IMO.
-- -Matt Calabrese