Jump to ratings and reviews
Rate this book

C++ Metaprogramming: Efficient Compile-Time Algorithms

Rate this book
C++ Efficient Compile-Time Algorithms is for C and C++ software engineers that want maximum efficiency via zero-cost compile-time execution of algorithms.

Highlights:Compile-time computationZero runtime overheadTemplate generic algorithmsPerfect hash metaprogrammingCompile-time data structures
Table of
Part Compile-Time Computation
1. Metaprogramming Introduction
2. Constant Specifiers
3. Constant Expression Evaluation
4. Compile-Time Branch Metaprogramming
5. Template Building Blocks
6. Type Traits
7. Static Reflection (C++26)
8. Legacy Recursive Template Metaprogramming
9. Runtime Metaprogramming

Part Data Structure Metaprogramming
10. Lookup Table Precomputation
11. Data Structure Unrolling
12. Perfect Hashing Theory
13. Perfect Hash Metaprogramming
14. Prefilled Fixed-Size Data Structures

Part Algorithm Metaprogramming
15. Perfect Compute Theory
16. Perfect Compute Examples
17. Brute-Force Perfect Compute
18. Text File Embedding
19. LLM Kernel Code Synthesis

Part Metaprogramming in C
20. Old-Style Perfect Hashing in C
21. Manual Inlining & Preprocessor Macros
22. Old-Style C/C++ Source Code Generation

Part Debugging Metaprogramming
23. Undefined Behavior in Metaprogramming
24. Preprocessor Macro Bugs
25. Code Bloat Mitigation
26. Slow Builds
27. Portability & Supportability

Part Compile-Time Primitives
28. Optimizers
29. Compiler Hints
30. Zero Runtime Cost Operations
31. Inline Functions
32. Closures, Lambdas and Functors
33. Switch Multiway Branch Optimizations
34. Computed Goto Jump Tables

341 pages, Kindle Edition

Published July 18, 2026

Loading...
Loading...

About the author

David Spuler

27 books8 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
0 (0%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
0 (0%)
No one has reviewed this book yet.