Thread-Safe Initialization: Constant Expressions

This lesson gives an overview of thread-safe initialization from the perspective of concurrency in C++ with Constant Expressions.

Constant expressions are expressions that the compiler can evaluate at compile-time; they are implicitly thread-safe. Using the keyword constexpr in with a variable makes the variable a constant expression. The constant expression must be initialized immediately.

Get hands-on with 1200+ tech skills courses.