I am a bit new with C++ so I was wondering if anyone knew the answer to this. How does one generate a compile time function in C++? i.e. if one wanted for some strange reason to compute the fibonacci sequence at compile time using templates and plug the value into a program how does one go about it? I use to have a book which discussed this and other generative metaprogramming issues but I forget how it's done (and I cannot find the book) :(.