[fusion] BOOST_FUSION_ADAPT_STRUCT private members?

Hi there, I'm looking for a way to BOOST_FUSION_ADAPT_STRUCT() private members of a struct. Is this possible? I'd like to parse with spirit2 directly into a struct with getters that should not be bypassed. Cheers, Stephan

Stephan Menzel wrote:
Hi there,
I'm looking for a way to BOOST_FUSION_ADAPT_STRUCT() private members of a struct. Is this possible?
I'd like to parse with spirit2 directly into a struct with getters that should not be bypassed.
No. But what I am planning instead is to provide a class adapter with user defined getters/setters. Would that help? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Joel,
No. But what I am planning instead is to provide a class adapter with user defined getters/setters. Would that help?
It would, if such construct would be a little more flexible than the macro. I don't want to complain about it since it does the job but sometimes I just like to save the hassle with a data only transfer struct and parse directly into a class without having all members public. Best regards... Stephan

On Thu, May 28, 2009 at 04:24:01PM +0200, Stephan Menzel wrote:
No. But what I am planning instead is to provide a class adapter with user defined getters/setters. Would that help?
It would, if such construct would be a little more flexible than the macro. I don't want to complain about it since it does the job but sometimes I just like to save the hassle with a data only transfer struct and parse directly into a class without having all members public.
I currently use the "transfer struct" method as well to get around this issue and therefore would like to articulate my interest in such an adapter as well. Matthias -- Matthias Vallentin vallentin@icsi.berkeley.edu http://www.icir.org/matthias
participants (3)
-
Joel de Guzman
-
Matthias Vallentin
-
Stephan Menzel