Skip to content

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