Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost.Fusion macro expansion
From: Steve Lorimer (steve.lorimer_at_[hidden])
Date: 2017-07-30 23:56:55


>From looking at the docs, is it because you're wrapping the member type in
parens?

BOOST_FUSION_DEFINE_STRUCT(
    (namespace0)(namespace1)...,
    struct_name,
    (member_type0, member_name0)
    (member_type1, member_name1)
    ...
    )

that is, have you tried:

BOOST_FUSION_DEFINE_STRUCT(
  (demo), curves,
  (std::map<std::string, std::string>, futures)
  (std::map<std::string, std::string>, credit_curves)
  )

On 30 July 2017 at 17:25, Robert Jones via Boost-users <
boost-users_at_[hidden]> wrote:

> Hi Peeps
>
> Can anyone tell me what's wrong with this? I think macro expansion is
> going awry, but I'm not sure why. Do I really have to typedef the map<...>
> type to keep Fusion happy?
>
> Thx.
>
> #include<string>
> #include<map>
>
> #include <boost/fusion/adapted/struct/define_struct.hpp>
> #include <boost/fusion/include/define_struct.hpp>
>
> BOOST_FUSION_DEFINE_STRUCT(
> (demo), curves,
> ((std::map<std::string, std::string>), futures)
> ((std::map<std::string, std::string>), credit_curves)
> )
>
> int main( )
> {
> return 0;
> }
>
> > make
> fusion.cpp|9 col 39| error: invalid declarator before ‘)’ token
>
> || ((std::map<std::string, std::string>), futures)
>
>
> Kind Regards
>
> Rob.
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> https://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