| 14 | T center_point; |
| 15 | T delta; |
| 16 | DeltaRange(const T ¢er, const T &range) |
| 17 | : CLI::Validator( |
| 18 | [this](const std::string &value) -> std::string { |
| 19 | T newValue; |
| 20 | auto result = CLI::detail::lexical_cast(value, newValue); |
| 21 | if(!(result && this->check(newValue))) { |
| 22 | return std::string("value not within range"); |
| 23 | } |
| 24 | return std::string{}; |
| 25 | }, |
| 26 | "RANGE"), |
| 27 | center_point(center), delta(range) {} |
| 28 | |
| 29 | CLI11_NODISCARD bool check(const T &test) const { |
| 30 | return (test >= (center_point - delta)) && (test <= (center_point + delta)); |
nothing calls this directly
no test coverage detected