Click here to Skip to main content
15,867,756 members
Articles / Programming Languages / C++11

Metaprogramming in C++: A Gentle Introduction

Rate me:
Please Sign up or sign in to vote.
5.00/5 (11 votes)
23 Mar 2021CPOL28 min read 17.1K   150   14  
Make your code more efficient by hacking your compiler to improve its optimization capabilities
In this article, we explore how to offload work onto the compiler so we can avoid the overhead of it at run-time. With these techniques, you can do things like compute factorials or construct complicated dynamic types that present high level data, all without any run-time overhead.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Just a shiny lil monster. Casts spells in C++. Mostly harmless.

Comments and Discussions