[PR #5652] [MERGED] Add explicit identifier to some constructors #26405

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5652
Author: @ghost
Created: 4/29/2020
Status: Merged
Merged: 4/30/2020
Merged by: @DHowett-MSFT

Base: masterHead: explicit


📝 Commits (1)

📊 Changes

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

View changed files

📝 src/cascadia/TerminalApp/ActionArgs.h (+2 -1)
📝 src/cascadia/TerminalApp/CascadiaSettings.h (+1 -1)
📝 src/cascadia/TerminalApp/DebugTapConnection.h (+1 -1)
📝 src/cascadia/TerminalApp/Pane.h (+1 -1)
📝 src/cascadia/TerminalApp/Profile.h (+1 -1)
📝 src/cascadia/TerminalApp/TerminalWarnings.h (+1 -1)
📝 src/cascadia/TerminalAzBridge/ConsoleInputReader.h (+1 -1)
📝 src/host/CommandNumberPopup.hpp (+1 -1)
📝 src/host/CopyFromCharPopup.hpp (+1 -1)
📝 src/host/conareainfo.h (+1 -1)
📝 src/host/conattrs.cpp (+1 -1)

📄 Description

Summary of the Pull Request

If a class has a constructor which can be called with a single argument, then this constructor becomes conversion constructor because such a constructor allows conversion of the single argument to the class being constructed. To ensure these constructors are passed the argument of its type, I labeled them explicit.

References

PR Checklist

  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed

Detailed Description of the Pull Request / Additional comments

In some header files, there were constructors that took a value that could involve implicit conversions, so I added explicit to ensure that does not happen.

Validation Steps Performed

Unit testing


🔄 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/5652 **Author:** [@ghost](https://github.com/ghost) **Created:** 4/29/2020 **Status:** ✅ Merged **Merged:** 4/30/2020 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `explicit` --- ### 📝 Commits (1) - [`d8c1149`](https://github.com/microsoft/terminal/commit/d8c11499f6f5c0e37c5c3323e3d05d4b0a357104) Add explicit identifier ### 📊 Changes **11 files changed** (+12 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/ActionArgs.h` (+2 -1) 📝 `src/cascadia/TerminalApp/CascadiaSettings.h` (+1 -1) 📝 `src/cascadia/TerminalApp/DebugTapConnection.h` (+1 -1) 📝 `src/cascadia/TerminalApp/Pane.h` (+1 -1) 📝 `src/cascadia/TerminalApp/Profile.h` (+1 -1) 📝 `src/cascadia/TerminalApp/TerminalWarnings.h` (+1 -1) 📝 `src/cascadia/TerminalAzBridge/ConsoleInputReader.h` (+1 -1) 📝 `src/host/CommandNumberPopup.hpp` (+1 -1) 📝 `src/host/CopyFromCharPopup.hpp` (+1 -1) 📝 `src/host/conareainfo.h` (+1 -1) 📝 `src/host/conattrs.cpp` (+1 -1) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request If a class has a constructor which can be called with a single argument, then this constructor becomes conversion constructor because such a constructor allows conversion of the single argument to the class being constructed. To ensure these constructors are passed the argument of its type, I labeled them explicit. <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [X] Tests added/passed <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments In some header files, there were constructors that took a value that could involve implicit conversions, so I added explicit to ensure that does not happen. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed Unit testing --- <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:15:52 +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#26405