Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] BOOST_FUSION_ADAPT_STRUCT with templated member
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2012-09-15 04:54:57


maybe another solution is

#define AB<2,3> MYABTYPE
BOOST_FUSION_ADAPT_STRUCT(
, Silly,
(MYABTYPE, ab))
#undef MYABTYPE

2 lines more, but sometimes it makes the code a bit more readable.

On 2012-09-15 01:43, osyo manga wrote:
> Hi.
>
> I think it can be solved by using the BOOST_IDENTITY_TYPE.
>
>
> #include <boost/fusion/include/define_struct.hpp>
> #include <boost/utility/identity_type.hpp>
>
> template<int a, int b>
> struct AB {};
>
> struct Silly{
> AB<2,3> ab;
> };
>
> BOOST_FUSION_ADAPT_STRUCT(
> Silly,
> (BOOST_IDENTITY_TYPE((AB<2,3>)), ab))
>
> ::Silly s;
>
> http://ideone.com/WEnJQ
>
>
> BOOST_IDENTITY_TYPE can be used from Boost 1.50.0.
>
> http://www.boost.org/doc/libs/release/libs/utility/identity_type/doc/html/index.html
>
>
> Thanks.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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