Tag: constexpr
7 posts
-
C++17 constexpr Lambdas: Implicit constexpr, Captures, and Limits
How C++17 constexpr lambdas work: when a lambda is implicitly constexpr, capture rules for constant evaluation, real GCC errors, and C++20 changes.
-
static, extern, const, constexpr, inline, volatile, mutable: What Each C++ Keyword Changes
A practical rundown of C++ storage and type-qualifier keywords - static, extern, const, constexpr, inline, volatile, and mutable - with what each one actually changes about linkage and lifetime.
-
C++ constexpr Functions and Variables: Compute at Compile
Compute values at compile time with constexpr: C++14/20 rule changes, constexpr vs const, a CRC32 lookup table, and fixes for ten common constexpr errors.
-
Moving Work to Compile Time in C++: constexpr, consteval, if constexpr and TMP
Move work into the C++ compiler with constexpr functions and classes, consteval for mandatory compile-time calls, if constexpr, and template metaprogramming.
-
C++ constexpr Functions: Compile-Time Evaluation Rules from C++11 to C++17
C++ constexpr functions: compile-time and runtime use, C++11 vs C++14 vs C++17, arrays, classes, and optimization. Practical examples and pitfalls.
-
C++ Constant Initialization: constexpr, constinit, and the Static Initialization Order Problem
How C++ decides whether a constant is initialized at compile time or run time, and why that distinction matters for static and global variables.
-
C++20 consteval: Forcing Compile-Time Evaluation Where constexpr Only Allows It
C++20 consteval explained: immediate functions vs constexpr, why a constexpr wrapper cannot pass its parameter, if consteval, C++23 propagation, and real diagnostics.