Boost logo

Boost Users :

From: Joel de Guzman (joel_at_[hidden])
Date: 2006-12-11 18:31:38


craigp wrote:

Hi craigp,

> i've been looking at the fusion library for a few days now, and i feel like i'm
> missing something (or just trying to make this fit for a use-case it's simply
> not suited for). i'm looking as using it for compile-time introspection for,
> let's say, serialization. one thing i was curious about was whether i can
> statically map each of my persistent types to a string (which could be used as
> the name of an xml element/attribute). i quickly determined that a map (of
> fusion-pairs) with more than just a few elements quickly overwhelms the
> compiler (msvc 7.1; raising the limit of 20 to ~50 just makes the compiler
> barf).

You should send me a cpp file that exhibits the problem.

> any thoughts on this? fusion provides what appears to be a lot of
> infrastructure, but i can't seem to take advantage of most of it ('out of the
> box', anyway). the best i've come up with so far is to create a for_each_it
> algorithm which, instead of calling back the visitor function with the value,
> calls it back with the corresponding iterator instead. this seems to work ok,
> but it appears i'd need to hand-write each algorithm (as well as each
> sequence), and i don't think that's how it was intended to be used. ;-)

Did you update VC7.1 to SP1 (http://tinyurl.com/kb3gy)? It makes
7.1 so much more useful. Also, have you considered 8.0?

> any thoughts? am i just barking up the wrong tree? what kinds of
> applications/use-cases were in mind when fusion was designed? most things i've
> thought of would (i'd guess) be impractical with today's compilers. i think
> there's some connection with fusion and spirit... how does spirit avoid the
> compiler limits i seem to run into?

I'm not sure. Perhaps I be of more help if I see some code
(as minimal as you can). Spirit2 (currently in development)
uses Fusion alright.

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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