[Fusion] issues when adapting an existing structure

Hi: I'm trying to adapt a structure for use with spirit. I have the following code: struct JAWSFunction { std::wstring FunctionType; std::wstring Description; std::wstring Synopsis; std::string ReturnType; std::vector<std::pair<std::wstring, std::wstring> > Parameters; }; //tell boost.Fusion about the JAWSFunction structure to allow it to be used with spirit. BOOST_FUSION_ADAPT_STRUCT(JAWSFunction, (std::wstring, FunctionType)(std::wstring, Description)(std::wstring, Synopsis)(std::wstring, ReturnType)(std::vector<std::pair<std::wstring, std::wstring> >, Parameters)) If I compile this with the std::vector<std::pair<std::wstring, std::wstring> > taken out, this works fine. However replacing the vector of pairs doesn't compile. How can I get this to work? Any help appreciated. Cheers Sean.

On Mon, Jul 25, 2011 at 12:28 PM, Sean Farrow <sean.farrow@seanfarrow.co.uk> wrote:
If I compile this with the std::vector<std::pair<std::wstring, std::wstring>
taken out, this works fine. However replacing the vector of pairs doesn’t compile.
How can I get this to work?
Have you tried with a typedef for std::vector<std::pair<std::wstring, std::wstring> >? The nested comma-space for the template arguments of vector<> is likely confusing the PP machinery. But I'm no expert. --DD

Hi Dominique: This works fantastically! Thank you. Cheers Sean. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Dominique Devienne Sent: 25 July 2011 18:53 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [Fusion] issues when adapting an existing structure On Mon, Jul 25, 2011 at 12:28 PM, Sean Farrow <sean.farrow@seanfarrow.co.uk> wrote:
If I compile this with the std::vector<std::pair<std::wstring, std::wstring>
taken out, this works fine. However replacing the vector of pairs doesn't compile.
How can I get this to work?
Have you tried with a typedef for std::vector<std::pair<std::wstring, std::wstring> >? The nested comma-space for the template arguments of vector<> is likely confusing the PP machinery. But I'm no expert. --DD _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Dominique Devienne
-
Sean Farrow