Part 2: Make enum -> enum class - #1258
Merged
Merged
Conversation
TobiKattmann
commented
Apr 7, 2021
| MESH_DEFORM = 3, | ||
| SOLUTION_AND_MESH = 4 | ||
| enum class RECORDING { | ||
| NO_RECORDING, |
Contributor
Author
There was a problem hiding this comment.
Added a NO_RECORDING option as the global NONE was used
3 tasks
TobiKattmann
commented
Apr 13, 2021
| /*! | ||
| * \brief Types of mathematical problem to solve | ||
| */ | ||
| enum ENUM_MATH_PROBLEM { |
Contributor
Author
There was a problem hiding this comment.
not used any more, nice 👍
TobiKattmann
marked this pull request as ready for review
April 21, 2021 13:18
pcarruscag
approved these changes
Apr 21, 2021
Contributor
Author
|
Codefactor is just complainig about the usual CIncEulerSolver. All other test pass, so I'll merge this and continue in Part III. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi all,
this is the continuation of #1242 . Change of the
enum's inoption_structure.hppintoenum class. This has the benefit of no implicit conversion to int and therefore increased safety with the enum type -> c++ core guidelines.If you want to sponsor a commit (which I highly recommend ;) ) then a good approach is to
enumof choice anenum classand remove the associated numbers.ENUM_INLET_TYPEcan be justINLET_TYPE. Also the option names to not be redundant so e.g.INLET_TYPE::PRESSURE_INLET_TYPEcould becomeINLET_TYPE::PRESSURENONEorNO_THINGoption if needed. Often the globalNONEoption is and that made a lot of people very angry and has been widely regarded as a bad move 🧙CConfig.c/hppand change the option type and everything there (because in theCConfigclass the variable is usually defined). Find theGetKind_yourOptionand search the code base for thatGetfunction.default; break;line -> otherwise the automated builds will fail on a warning (clang is used, I found gcc does only complain with an additional flag)Have fun :)
Related Work
#1242
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.