|
Boost : |
Subject: Re: [boost] [fusion] useful as_variant in spirit2
From: Joel de Guzman (joel_at_[hidden])
Date: 2009-09-26 12:00:24
Steven Watanabe wrote:
> AMDG
>
> Christian Holmquist wrote:
>> The function in boost\spirit\home\support\detail\as_variant.hpp seems to
>> have no dep. on spirit, and it's a useful utility that would fit into
>> fusion/support/as_variant.hpp>
>> IIUC it's a meta function that computes a variant<T0, ..., TN> from a
>> fusion
>> sequence<T0, ..., TN>. I think there's no reason for a runtime
>> counterpart,
>> i.e. as_variant<Seq>::type is a valid expression but as_variant(Seq) and
>> result_of::as_variant<Seq>::type is not. Thus, the function is already
>> complete.
>>
>> Does it seem reasonable to you to include in fusion? The work of
>> moving it
>> would be to only update the docs, as spirit2 probably does excessive
>> testing
>> of this function anyway.
>> I could collect the docs from other parts of fusion, and put together a
>> separate test file if needed. All real work is already done, just
>> presentation and formality that is lacking.
>>
>
> How is this different from boost::make_variant_over?
This version in spirit::detail was supposed to be a workaround.
At one point, boost::make_variant_over had some problems with
arbitrary forward sequences. I recall mentioning this problem
with Eric Friedman at BoostCon 08. This may be a problem long
gone. I'll check as soon as I can find some time.
Regards,
-- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk