|
Boost : |
Subject: Re: [boost] [fusion] BOOST_FUSION_ADAPT_TPL_STRUCT
From: Joel de Guzman (djowel_at_[hidden])
Date: 2014-06-29 17:41:21
On 6/27/14, 11:10 PM, Greg Rubino wrote:
> Hello all,
>
> I'm trying to do something like this with fusion:
>
> struct exists_tag {};
>
> template <typename A>
> struct unary {
> type_a m_name;
> };
>
> template <>
> struct unary<exists_tag> {
> type_b m_name;
> };
>
> BOOST_FUSION_ADAPT_TPL_STRUCT((A), (unary)(A), (type_a)(m_name));
> BOOST_FUSION_ADAPT_TPL_STRUCT((), (unary)(exists_tag), (type_b)(m_name));
>
> I'm not sure if I'm way off here, or if there is some way to accomplish
> this that I'm just not seeing.
Why do you need to adapt the specialization? If you adapt the main template,
fusion can pickup all the specializations just fine.
Regards,
-- Joel de Guzman http://www.ciere.com http://boost-spirit.com http://www.cycfi.com/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk