Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement abrupt hy cg interface #31

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

J-Hizzle
Copy link
Contributor

Solves #29

@J-Hizzle
Copy link
Contributor Author

clang-tidy suggests making Slab::interfaceType_ of enum type in order to secure the switch in setWeightInHY. I tried implementing that, but I don't really know how to properly handle enum type member variables.

@XzzX
Copy link
Owner

XzzX commented Jan 31, 2025

clang-tidy suggests making Slab::interfaceType_ of enum type in order to secure the switch in setWeightInHY. I tried implementing that, but I don't really know how to properly handle enum type member variables.

Reason for the warning: Since int allows many values you always have to cover all possible values in switch cases to be save nothing strange happens if the user puts in an int you did not expect. C++ offers enum classes that restrict to only well defined values and gives them meaningful names.

See 029ae48

@XzzX
Copy link
Owner

XzzX commented Jan 31, 2025

There are a lot of ifs that might deteriorate performance. However, the design is clear. So I would keep them until we see performance problems.

@XzzX XzzX self-requested a review January 31, 2025 08:54
@XzzX XzzX enabled auto-merge January 31, 2025 08:55
@XzzX XzzX merged commit d14f428 into XzzX:main Jan 31, 2025
10 checks passed
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.

2 participants