You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the .choices(...) method require passing the list of choices as individual arguments. This works well when the list of choices is known statically, but if the list is dynamic (ex. computed into a std::vector<T>), setting the choices becomes unnecessarily verbose (you'd have to loop over the values and call .add_choice() for each one).
Unfortunately, the variadic .choices(...) interface prevents overloading, so the suggestion is to add a new method along the lines of:
template<class T>
Argument& choices_list(const T& list) {
for (const auto& v : list) {
add_choice(v);
}
return *this;
}
The text was updated successfully, but these errors were encountered:
Currently, the
.choices(...)
method require passing the list of choices as individual arguments. This works well when the list of choices is known statically, but if the list is dynamic (ex. computed into astd::vector<T>
), setting the choices becomes unnecessarily verbose (you'd have to loop over the values and call.add_choice()
for each one).Unfortunately, the variadic
.choices(...)
interface prevents overloading, so the suggestion is to add a new method along the lines of:The text was updated successfully, but these errors were encountered: