1

I have a few questions regarding boost::fusion

1) What exactly is the emphasis on the compile-time capabilities of fusion? Is it just to "glue" template metaprogramming with "normal" run-time programming (hence they say fusion is the mixing of compile time with run time code)? If so, I thought you could combine metaprogramming with normal run-time C++ already?

2) Does fusion only work with tuples? I seem to see tuples in all the fusion examples. Or, is tuple just an example of a fusion "sequence" and tuple, along with other types can count towards a fusion sequence?

3) Again, trying to understand fusion- how does fusion differ from a framework to allow generic coding? We have templates for that right? Again, is the emphasis on fusion being with the compile-time programming?

4) Are there any prerequisite boost libraries one needs to know in order to use fusion? I have seen/heard MPL mentioned a few times.

5) What are the areas in which fusion most used?

6) Why do a lot of the metaprogramming (compile-time) functions return types?

Any additional advice regarding boost fusion is most appreciated.

user997112
  • 29,025
  • 43
  • 182
  • 361
  • 3
    Isn't the Boost.Fusion documentation full of examples which cover at least 50% of your questions? – Kerrek SB Dec 17 '13 at 17:16
  • @KerrekSB to be completely blunt there was 2 or 3 paragraphs which don't answer my questions and then the remaining 200-odd pages just list the API (which isnt very helpful) and the examples were 2 or 3 liners. – user997112 Dec 17 '13 at 17:18
  • 1
    For example, how can you map values to types, without Boost.Fusion? – Igor R. Dec 17 '13 at 17:19
  • Maybe best to break it down into separate questions... I know that Fusion is huge, but this question seems to be asking a lot. – Kerrek SB Dec 17 '13 at 17:29
  • (Also, question 5 is loaded: Who claimed that Fusion was "very useful"? Wouldn't it be OK if it was just sort-of useful?) – Kerrek SB Dec 17 '13 at 17:30
  • @KerrekSB have modified it. Would you be able to answer #6? That may help me to understand the rest. – user997112 Dec 17 '13 at 17:38
  • 1
    @user997112 metafunctions *always* return types, by definition. – Igor R. Dec 17 '13 at 18:46

0 Answers0