Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] Understanding Fusion
From: Cromwell Enage (sponage_at_[hidden])
Date: 2009-07-22 13:57:03


--- On Sat, 7/18/09, Robert Jones wrote:
> Hi All
>
> I'm very much a Fusion newbie, just getting may head around it, so a
> really basic question!
>
> From the intro page, when we write
>
> #include <boost/fusion/sequence.hpp>
> #include <boost/fusion/include/sequence.hpp>
>
> vector<int, char, std::string> stuff
> for_each(stuff, print_xml());
>
>
> am I correct in believing that there is no loop involved in the
> for_each, and that this resolves, at compile time, to a linear
> list of function calls?

Yes. IIRC, it resolves to the equivalent of:

  print_xml()(int());
  print_xml()(char());
  print_xml()(std::string());

HTH,
Cromwell D. Enage

      


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