7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

Add add_choices accepting std::vector to argparse for convenience.

This commit is contained in:
Alex Shvartzkop 2024-03-03 21:14:49 +03:00
parent 991b4299d6
commit 1126227206

View File

@ -783,6 +783,12 @@ public:
return *this;
}
template <typename T> Argument &add_choices(std::vector<T> &&choices) {
for (T &choice : choices)
add_choice(std::forward<T>(choice));
return *this;
}
template <typename T, typename... U>
Argument &choices(T &&first, U &&... rest) {
add_choice(std::forward<T>(first));