What static, inline, const, constexpr Mean and When to Use Them

Andreas Fertig

⏱ 60 minute session
beginner
intermediate
09:30-10:30, Saturday, 20th June 2026

C++ comes with a whole toolbox of keywords you can apply to types and functions. You think it's straightforward? My experience says otherwise. There are false-friends like static, which I often see misapplied.

In this talk, I will demystify those tricky little keywords. You'll learn what they really mean, how they behave in different contexts, and — most importantly — when to use them (and when not to). Think const, constexpr, consteval, constinit: yes, C++ has more flavors of constness than your local ice cream shop. We'll explore them all.

We'll go beyond syntax and dive into what's actually happening in the language.

While the talk includes some features from C++23, most of what we cover is rooted in C++11 or even classic C++98. We'll touch on important concepts like the One Definition Rule (ODR) and top-level qualifiers, giving you a deeper understanding of how these keywords shape your code.

After this session, you'll walk away knowing exactly where each keyword belongs. No more guesswork. Just the right keyword in the right place.


🏷 constexpr
🏷 constinit
🏷 consteval
🏷 odr
🏷 inline
🏷 static
🏷 const

Andreas Fertig

Andreas Fertig is an expert C++ trainer and consultant who delivers engaging and impactful training sessions, both on-site and remotely, to teams around the globe.

As an active member of the C++ standardization committee, Andreas contributes directly to shaping the future of the language. He shares insights on writing cleaner, more efficient C++ code at international conferences. He publishes specialist articles, e.g., for iX magazine, and has published several C++ textbooks.

With C++ Insights (https://cppinsights.io), Andreas has created an internationally recognized tool that enables users to look behind the scenes of C++ and thus understand constructs even better.

Discover more about Andreas and his work at andreasfertig.com.