If you start googling around, be aware that sometimes people call what (I think) Casey is doing code generation (i.e. you write a program to write another program) and reserve the term "meta-programming" for cases where you are using the facilities of the language itself to generate code automatically. So, in C++, using the preprocessor or template system to generate code would be "meta-programming" and writing a program (regardless of the language used) to output another program is called "code generation." Is that correct terminology? I don't really know or care but it helps when searching.
Here are few links you might find helpful.
The preprocessor is more powerful than most people realize. Here are a few links from basic to black magic (beware that, from what I recall, the last one is using gcc preprocessor extensions so it doesn't all work on MSVC):
Tips and tricks using the preprocessor (part one)
Tips and tricks using the preprocessor (part two)
C Pre-Processor Magic
The template system is the more standard meta-programming facility in modern C++. It gets my vote for the world's worst functional language that people actually use :). I know some books if you are interested but it is pretty main stream so google can tell you everything you need to know.
For code generation, there are a variety of approaches from programs that you run manually when you find you need a new version of something it can generate (like the Stack example above), programs that get hooked into the build system automatically to sophisticated programs that actually parse the C++ that you write and generate additional code for you. Here is a link that discusses the later:
Implementing a code generator with libclang
If you want to go the code generation route, you might want to explore using a template engine
or a language like perl that really specializes in text manipulation. You can do it in C but I suspect that Casey has built up a good library over the years that you will not have at the start.
As a quick personal note, a number of years ago I was on a project that involved very sophisticated algorithms and heuristics which really required that domain experts write and tune the initial code themselves. They were experts in their domain but not expert software developer so dealing with pages of template induced error messages was not going to fly. They also needed to do lots of iterations to tune their heuristics so quick builds times were important. To support all this we moved away from templates to code generation and it worked like a charm. The code was much simpler to debug for everyone and build times were much faster. I think boost is a technical tour de force but, in my opinion, it is the wrong way to solve the problem.