Get the list of options (user facing function, so returns raw pointers), has optional filter function
| 6014 | |
| 6015 | /// Get the list of options (user facing function, so returns raw pointers), has optional filter function |
| 6016 | std::vector<const Option *> get_options(const std::function<bool(const Option *)> filter = {}) const { |
| 6017 | std::vector<const Option *> options(options_.size()); |
| 6018 | std::transform(std::begin(options_), std::end(options_), std::begin(options), |
| 6019 | [](const Option_p &val) { return val.get(); }); |
| 6020 | |
| 6021 | if (filter) { |
| 6022 | options.erase( |
| 6023 | std::remove_if(std::begin(options), std::end(options), [&filter](const Option *opt) { return !filter(opt); }), |
| 6024 | std::end(options)); |
| 6025 | } |
| 6026 | |
| 6027 | return options; |
| 6028 | } |
| 6029 | |
| 6030 | /// Non-const version of the above |
| 6031 | std::vector<Option *> get_options(const std::function<bool(Option *)> filter = {}) { |
no test coverage detected