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

For enums, use to_string, from_string. [Depends on TS 21.] #77

Merged
merged 3 commits into from
May 22, 2024

Conversation

mgates3
Copy link
Collaborator

@mgates3 mgates3 commented Feb 17, 2024

Depends on icl-utk-edu/testsweeper#21

Use standard to_string function to convert enum to string.
Introduce to_char and to_c_string functions.
Introduce from_string function to convert string to enum.
This also makes the ParamEnum constructor much simpler.

@mgates3
Copy link
Collaborator Author

mgates3 commented Feb 17, 2024

@weslleyspereira Any thoughts on this PR? Would this affect <T>LAPACK or other things you work on?

Basically, this replaces enum-specific functions like uplo2str and str2uplo with overloaded versions like to_string and from_string. Since you can't overload on the return type, from_string takes a dummy argument to specify the return type. TestSweeper no longer needs to be told what a parameter's input & output functions are (e.g., uplo2str, str2uplo), it can just assume to_string and from_string.

@weslleyspereira
Copy link
Contributor

@weslleyspereira Any thoughts on this PR? Would this affect <T>LAPACK or other things you work on?

I think it is a good idea! Thanks for tagging me. I don't think it will change anything in <T>LAPACK.

@mgates3 mgates3 force-pushed the to_string branch 2 times, most recently from dae63a0 to e979298 Compare May 22, 2024 20:13
@mgates3 mgates3 merged commit 855ac97 into icl-utk-edu:master May 22, 2024
8 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