diff --git a/asibfm700/asibfm700_configfile.h b/asibfm700/asibfm700_configfile.h index 4988db7..b3521fc 100644 --- a/asibfm700/asibfm700_configfile.h +++ b/asibfm700/asibfm700_configfile.h @@ -129,6 +129,13 @@ public: } value = r; + } else if constexpr (mcc::traits::mcc_time_duration_c) { + typename value_t::rep vd; + + bool ok = self(str, vd); + if (ok) { + value = value_t{vd}; + } } else { return false; } @@ -231,8 +238,8 @@ public: if constexpr (std::convertible_to) { res = static_cast(std::forward(val)); - } else if constexpr (std::constructible_from) { - res = T{std::forward(val)}; + // } else if constexpr (std::constructible_from) { + // res = T{std::forward(val)}; } else { res = std::unexpected(std::make_error_code(std::errc::invalid_argument)); } @@ -707,16 +714,9 @@ protected: bool ok = true; - if constexpr (std::is_arithmetic_v || std::ranges::output_range || - std::ranges::range) { + if constexpr (std::is_arithmetic_v || mcc::traits::mcc_output_char_range || + std::ranges::range || mcc::traits::mcc_time_duration_c) { return base_t::defaultDeserializeFunc(str, value); - } else if constexpr (mcc::traits::mcc_time_duration_c) { - typename value_t::rep vd; - - ok = base_t::defaultDeserializeFunc(str, vd); - if (ok) { - value = value_t{vd}; - } } else if constexpr (std::same_as) { // assume here all angles are in degrees double vd; ok = base_t::defaultDeserializeFunc(str, vd);