Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] BOOST_FUSION_ADAPT_STRUCT with templated member
From: osyo manga (manga.osyo_at_[hidden])
Date: 2012-09-14 19:43:36


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 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