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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/15100
Author: @lhecker
Created: 4/4/2023
Status: Merged
Merged: 4/4/2023
Merged by: @zadjii-msft

Base: mainHead: dev/lhecker/static-constexpr


📝 Commits (1)

  • c1c67b3 Replace statics in headers with inline constants

📊 Changes

11 files changed (+32 additions, -32 deletions)

View changed files

📝 src/cascadia/TerminalApp/TerminalPage.h (+3 -3)
📝 src/cascadia/TerminalApp/TerminalTab.h (+3 -3)
📝 src/cascadia/TerminalConnection/AzureClientID.h (+1 -1)
📝 src/cascadia/TerminalCore/Terminal.hpp (+2 -2)
📝 src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h (+6 -6)
📝 src/cascadia/TerminalSettingsModel/DynamicProfileUtils.h (+1 -1)
📝 src/cascadia/TerminalSettingsModel/LegacyProfileGeneratorNamespaces.h (+3 -3)
📝 src/cascadia/inc/WindowingBehavior.h (+7 -7)
📝 src/inc/til/spsc.h (+3 -3)
📝 src/inc/til/string.h (+1 -1)
📝 src/renderer/inc/FontInfoBase.hpp (+2 -2)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/15100 **Author:** [@lhecker](https://github.com/lhecker) **Created:** 4/4/2023 **Status:** ✅ Merged **Merged:** 4/4/2023 **Merged by:** [@zadjii-msft](https://github.com/zadjii-msft) **Base:** `main` ← **Head:** `dev/lhecker/static-constexpr` --- ### 📝 Commits (1) - [`c1c67b3`](https://github.com/microsoft/terminal/commit/c1c67b35321d76140410de7b88a251bfbcae7ba0) Replace statics in headers with inline constants ### 📊 Changes **11 files changed** (+32 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/TerminalPage.h` (+3 -3) 📝 `src/cascadia/TerminalApp/TerminalTab.h` (+3 -3) 📝 `src/cascadia/TerminalConnection/AzureClientID.h` (+1 -1) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+2 -2) 📝 `src/cascadia/TerminalSettingsEditor/ColorSchemeViewModel.h` (+6 -6) 📝 `src/cascadia/TerminalSettingsModel/DynamicProfileUtils.h` (+1 -1) 📝 `src/cascadia/TerminalSettingsModel/LegacyProfileGeneratorNamespaces.h` (+3 -3) 📝 `src/cascadia/inc/WindowingBehavior.h` (+7 -7) 📝 `src/inc/til/spsc.h` (+3 -3) 📝 `src/inc/til/string.h` (+1 -1) 📝 `src/renderer/inc/FontInfoBase.hpp` (+2 -2) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:40:44 +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#30421