Talk

Clauses, qualifiers and patterns

  • In Russian
Presentation pdf

In C++98 we had const, volatile, static, extern, inline and of course patterns. In C++11 thread_local, constexpr and also extern for patterns were added. In C++14 variables patterns were added. In C++17 — inline variables. In C++20 they promise to add consteval and constinit. Have you ever wondered what is static inline thread_local constexpr const volatile variable?

In this talk Mikhail will try to sort out all this variety of keywords. We will recall linkage, storage duration and patterns instantiation (and learn what will change with the dawn of modules in C++20). Examine connection between template and inline, static and constexpr. Understand why we need extern now when we have inline. And will realize how it took almost 20 years to learn how to declare constants.

The talk is designed for basic knowledge of C++.

  • #corelanguage
  • #longroadtoconst
  • #tutorial
Talks