It is a virtue to program as const as possible in modern C++. Your program is by design way more type safe, has fewer concurrency issues, and runs with high probability faster.
Const has many flavors in modern C++. Thanks to const, you can protect a value against mutation. With constexpr, you can initialize and compute values at compile time. Thanks to conteval, a computation can only run at compile time. In the end, constinit empowers you to initialize a modifiable value at compile time.
Let me show you in my lecture how you can initialize a value with constexpr and constinit in a thread-safe way. Let me show you how const and constexpr help you protect values from mutation and, therefore, make them immune to data races. Finally, let me show you how constexpr and consteval empowers you to improve the performance of your program and get functions that are by design easy to test, easy to maintain, and implicitly thread-safe.
ALL TALK SESSIONS CAN BE ACCESSED FROM THE MAIN LOBBY:
https://cppcon.digital-medium.co.uk/