Variadic templates and Fibonacii sequence

This time I'll continue to explore variadic templates. As I mentioned from previous blog variadic templates gives the ability to create compact, type-safe code, which does job at the compile time. No runtime surprises!
Let see how variadic templates can help to create a Fibonacii sequence, a sequence which is evaluated, calculated at the compile time. Program will not use any traditional loop constructs like "for", "while" or conditional operators, because these expressions are runtime expressions and not applicable to metaprogramming. I'll use the same "for_each" function mentioned in previous blog:
indexes.h
for_each.h

and I'll add fibonacii sequence generator:
fibonacii.cpp

Here tuple does a great job. It holds a list of different types: Fib<0>, Fib<1>, Fib<2> ..., but these different data types has constant integer with the same name: "value". So it is very tempting to iterate through tuple elements and do something interesting with those "values".

Variadic templates

Variadic templates are very powerful feature. Now variadic templates are in C++0x standard library and it greatly simplifies tape-safe code. At the moment there are not so much examples with the use of variadic templates. Two weeks ego I've started to familiarize with such template technique by reading article: Introduction to variadic templates. I've been hooked, ... no loops, no condition checking, it seems that you have to shift your thoughts into another dimension. In the forums I've found such C++ snippet:
indexes.h
and on top I've added my own:
for_each.h
This small library has one function: "for_each", but it does great job: it iterates through elements of a tuple and applies those elements to a function object as parameters. Function object (functor) then defines what kind of job should be done. Let's look from application point of view:
application

functionality of such "for_each" is more less the same as implemented in boost::fusion::for_each, just in our case we are using std::tuple, when fusion library requires to define it own boost::fusion::tuple, which is not so convenient in many cases. Let's better stick to the standard!
By the way, boost::fusion library intension is to fuse template metaprogramming and runtime programming. And it seems it's new and powerful programming paradigm.