Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] BOOST_FUSION_ADAPT_STRUCT with templated member
From: niXman (i.nixman_at_[hidden])
Date: 2012-09-14 12:29:26


2012/9/14 Nevin Liber:
> The following piece of code:
>
> #include <boost/fusion/include/adapt_struct.hpp>
>
> template<int a, int b>
> struct AB {};
>
> BOOST_FUSION_ADAPT_STRUCT(
> , Silly,
> (AB<2,3>, ab))
>
> fails with:
>
> main.cpp:8:15: error: macro "BOOST_FUSION_ADAPT_STRUCT" passed 3 arguments,
> but takes just 2
> main.cpp:6:1: error: 'BOOST_FUSION_ADAPT_STRUCT' does not name a type
>
> I am assuming this is because the preprocessor splits line 8 into 'AB<2',
> '3>', 'ab'.
>
> How do I work around this?

Hi,

Use BOOST_FUSION_ADAPT_TPL_STRUCT:
http://www.boost.org/doc/libs/1_51_0/libs/fusion/doc/html/fusion/adapted/adapt_tpl_struct.html

-- 
Regards,
niXman
___________________________________________________
Dual-target(32 & 64 bit) MinGW compilers for 32 and 64 bit Windows:
http://sourceforge.net/projects/mingwbuilds/

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net