Have a look at typelists. You'll probably want to get a hold of a copy of 'Modern C++ design' for some explanation.