Boost logo

Boost Users :

Subject: Re: [Boost-users] how to compare fusion adapted structures
From: Christopher Schmidt (mr.chr.schmidt_at_[hidden])
Date: 2010-05-06 14:52:40


Olaf Peter schrieb:
>>> in my project I do have a lot of fusion adapted structures (due to use
>>> for/with spirit).
>>
>> Just a note aside: starting with release 1.43 you are able to define
>> fusion sequences in situ. If you just need public attributes in your
>> structs, without helper functions, you can probably save some typing. See
>
> really cool, thanks. Using it, I've got a Segmentation fault. Got
> something wrong?

BOOST_FUSION_DEFINE_STRUCT(
    (),
    foo,
    (std::string, a)
    (std::string, b)
    )

should be

BOOST_FUSION_DEFINE_STRUCT(
    BOOST_PP_EMPTY(),
    foo,
    (std::string, a)
    (std::string, b)
    )

. Other than that, you did not include <string> . I am pretty sure your
compiler did not find an adequate operator== for std::string. The
compiler should have printed an error though. Which one are you using?

-Christopher


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