Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] BOOST_FUSION_ADAPT_STRUCT with templated member
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2012-09-14 15:35:28


AMDG

On 09/14/2012 11:24 AM, Nevin Liber wrote:
> On 14 September 2012 12:43, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>
>>> #include <boost/fusion/include/adapt_struct.hpp>
>>>
>>> template<int a, int b>
>>> struct AB {};
>>>
>>> BOOST_FUSION_ADAPT_STRUCT(
>>> , Silly,
>>> (AB<2,3>, ab))
>>>
>>> fails
>>
> <snip>
>
> I was hoping for something more scalable. Amongst other things, the real
> code has a number of boost::array of varying types of sizes, so it is
> either a lot of typedefs or a lot of wrapper classes to get the number of
> template arguments down to one.
>

There's this trick:
function_traits<void(AB<2, 3>)>::arg1_type.
Unfortunately, this loses CV qualifiers.

In Christ,
Steven Watanabe


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