[PR #15100] Replace statics in headers with inline constants #30426

Open
opened 2026-01-31 09:40:45 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15100

State: closed
Merged: Yes


C++ is a very well balanced and reasonable language, which is why
static inside classes means "shared between all instances", whereas
static outside of classes means "not shared between all .cpp files".

32 years after this problem was written onto parchment it was fixed with
the introduction of inline variables in C++17, which tell the compiler
to deduplicate variables the same way it deduplicates functions.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15100 **State:** closed **Merged:** Yes --- C++ is a very well balanced and reasonable language, which is why `static` inside classes means "shared between all instances", whereas `static` outside of classes means "not shared between all .cpp files". 32 years after this problem was written onto parchment it was fixed with the introduction of inline variables in C++17, which tell the compiler to deduplicate variables the same way it deduplicates functions.
claunia added the pull-request label 2026-01-31 09:40:45 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30426