Skip to content

Conversation

@PastaPastaPasta
Copy link
Member

Issue being fixed or feature implemented

Avoid lots of static_cast's from enums to underlying types. Communicate intention better

What was done?

implement c++23 inspired ToUnderlying, then see std::to_underlying and https://en.cppreference.com/w/cpp/types/underlying_type; Then, we use this instead of static_casts for enums -> underlying type

How Has This Been Tested?

make check

Breaking Changes

None

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@PastaPastaPasta PastaPastaPasta added this to the 19 milestone Feb 17, 2023
@PastaPastaPasta
Copy link
Member Author

I'm really confused why this build fails... Please help 🙈

@UdjinM6
Copy link

UdjinM6 commented Feb 18, 2023

I'm really confused why this build fails... Please help 🙈

git add src/util/underlying.h ;)

@PastaPastaPasta
Copy link
Member Author

I'm really confused why this build fails... Please help 🙈

git add src/util/underlying.h ;)

Oh 🙈 I'll do that tonight 😂

@knst
Copy link
Collaborator

knst commented Feb 19, 2023

LGTM, but let's add these also and may be this

@UdjinM6
Copy link

UdjinM6 commented Feb 19, 2023

linter complains

A new circular dependency in the form of "llmq/debug -> llmq/dkgsessionhandler -> llmq/debug" appears to have been introduced.
A new circular dependency in the form of "llmq/debug -> llmq/dkgsessionhandler -> llmq/dkgsession -> llmq/debug" appears to have been introduced.

@PastaPastaPasta
Copy link
Member Author

linter complains

A new circular dependency in the form of "llmq/debug -> llmq/dkgsessionhandler -> llmq/debug" appears to have been introduced.
A new circular dependency in the form of "llmq/debug -> llmq/dkgsessionhandler -> llmq/dkgsession -> llmq/debug" appears to have been introduced.

resolved

@knst
Copy link
Collaborator

knst commented Feb 20, 2023

utACK

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, utACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants