+ template <typename Float>
+ std::enable_if_t<std::is_floating_point_v<Float>, void> parse_float(
+ std::optional<std::string_view> value, Float &f_value)
+ {
+ f_value = Float();
+ if (!value)
+ {
+ help_and_exit("missing value for ", current_option());
+ }
+ auto str = *value;
+ std::istringstream is{std::string(str)};
+ if (!(is >> f_value))
+ {
+ help_and_exit("invalid value for: ", current_option());
+ }
+ }
+ template <typename Float>
+ std::enable_if_t<std::is_floating_point_v<Float>, void> parse_float(
+ std::optional<std::string_view> value, std::optional<Float> &f_value,
+ bool required = true)
+ {
+ if (!required && !value)
+ {
+ f_value = std::nullopt;
+ return;
+ }
+ f_value.emplace();
+ this->parse_float(value, f_value.value());
+ }