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

Convert default value using action() #350

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

veimmone
Copy link

@veimmone veimmone commented May 2, 2024

If using an action() to convert the input values into custom data types, the default value poses an issue when using choices(). m_choices is a vector<string> so the default value also has to be comparable to a string, for the given value to be accepted.

This commit solves this by patching get() to convert the default value using the same action().

It is not the cleanest solution (default value has to be given as string instead of the target type), but the alternative I came up with would have changed m_choices to a typed vector which would have had wider consequences so I didn't pursue that path.

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.

1 participant