Skip to content

Conversation

wdconinc
Copy link
Contributor

@wdconinc wdconinc commented Aug 16, 2025

Briefly, what does this PR introduce?

This PR modifies the unscoped enum ESigmaMode to a scoped enum, and avoids the implicit integer conversion by correcting the operator<< signature. Before this fix, the output was 0 or 1 (since the incorrectly-signatured operator<< is not used); after this fix, the output is abs or rel.

The scoping of the enum adds a layer of safety since the symbol abs could previously shadow the standard function std::abs.

This aligns with the enabled clang-tidy check cppcoreguidelines-use-enum-class, https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/use-enum-class.html.

What kind of change does this PR introduce?

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

@wdconinc wdconinc changed the title demo: strongly-typed enum SiliconChargeSharingConfig::ESigmaMode (don't merge) fix: enable strongly-typed enum SiliconChargeSharingConfig::ESigmaMode Aug 29, 2025
@wdconinc wdconinc requested a review from veprbl August 29, 2025 18:35
@wdconinc
Copy link
Contributor Author

Rebasing for #2057.

@wdconinc wdconinc force-pushed the strongly-typed-enums branch from 18f100d to 79ca18c Compare August 29, 2025 18:48
@wdconinc wdconinc enabled auto-merge August 29, 2025 18:48
@wdconinc wdconinc added this pull request to the merge queue Aug 29, 2025
Merged via the queue into main with commit 34b2fd8 Aug 29, 2025
125 of 129 checks passed
@wdconinc wdconinc deleted the strongly-typed-enums branch August 29, 2025 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants