How C++ Cheats Reality: Shift From Runtime to Compile Time

Опубликовано: 21 Сентябрь 2026
на канале: learn++
373
14

Explore the most powerful features of modern C++: shifting work from runtime to compile time.
Why compute values at runtime when the compiler can do the heavy lifting for you before your program even executes? In this video, we unpack the exact differences between const, constexpr, and C++20’s consteval (immediate functions). We’ll look under the hood at how compile-time evaluation works, when to use each keyword, and how to write zero-overhead modern C++ code.

Complete Playlist ▶︎
   • Effective Modern C++  
This series covers fundamental mechanics from Scott Meyers' classic literature " Effective Modern C++ ".

CHAPTERS
0:00 Duplicate Work in a Sound Engine
0:55 const constexpr consteval
1:24 const
2:03 constexpr variable
2:50 constexpr function
3:25 constexpr objects
3:55 constexpr methods
4:18 Literal Type
4:28 Template Arguments
5:28 if constexpr
6:17 if consteval
7:46 When constexpr is Not Sufficient
8:47 Spectrum Model
9:51 consteval
10:22 Revisit if consteval in Spectrum Model
11:02 How These Tools Improved Our Sound Engine
11:42 DO NOT Use constexpr Everywhere
12:21 Revisit Sound Engine
12:45 Quiz - 1
13:06 Quiz - 2
13:30 Quiz - 3
14:03 Summarize
15:00 Thank You

🖊 A bit about me:
I am a software engineer with experience in working with both High Frequency Trading and Product based firms. My goal with this channel is to provide easy-to-understand explanation of technical terms and concepts which are essential in producing good quality software.

🔔 SUBSCRIBE to debug your fundamental understanding of computer science from the core out:
   / @learn-with-nibble  

#cpp #computerscience #constexpr #softwareengineering #coding #learn #hft #const #consteval #compiletime #runtime