Meta Template Programming – where to start?

A good friend of my asked me how to get started in meta-template programming. Of course, the first thing is to know C++ and know it well. Other than that, I think my best advise is to ensure you completely understand how the C++ template generation process works. For example, if you don’t know what SFINAE stands for you’re probably not really to start writing meta-templates (of course, that doesn’t mean you are not ready to start learning).

There are three books that, in my opinion, you need to read before you do anything else. By read I mean to have read and understood. They are:

C++ Templates: The Complete Guide

This is basically the bible as far as template programming is concerned. If you’ve not read this you don’t know C++ templates!

Modern C++ Design: Applied Generic and Design Patterns

Basically, everything you’ll ever want or need to know to write meta-template code.

C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond

Really advanced stuff. Shows you how to use the Boost MPL (Meta Programming Language) to do really really clever things. Don’t even think about reading this until you’ve at least read the first book, otherwise you head may just explode.

Finally, I am now taking requests for articles on my blog so if there is anything specific you wanted to know just make a request on there and I’d be more than happy to try and write a nice article for you 🙂

I hope this helps.