Preface

Another arcane text about an overly complex language! C++ is already difficult enough to master; why do people feel the need to make it even more difficult?

C++’s power comes at a price, but with the latest revisions of the language, the bar has been drastically lowered. The improvements in C++11 and C++14 have had a positive impact in many areas, from how you write a loop to how you can write templates.

We’ve had the idea of writing about template metaprogramming for a long time, because we wanted to demonstrate how much easier it has become. We also wanted to prove its usefulness and efficiency. By that we mean that it’s not only a valid solution, but sometimes the best solution.

Last but not least, even if you don’t use metaprogramming every day, understanding its concepts will make you a better programmer: you will learn to look at problems differently and increase your mastery and understanding of the language.

A Journey of a Thousand Miles Begins with a Single Step

Really mastering C++ metaprogramming is difficult and takes a lot of time. You need to understand how compilers work to get around their bugs and limitations. The feedback you can receive when you have an error is more often than not arcane.

That is the bad news.

The good news is that you don’t need to master C++ metaprogramming, because you are standing on the shoulders of giants.

In this report, we will progressively expose you to the technique and its practical applications, and give you a list of ...

Get Practical C++ Metaprogramming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.