From 64f27ec2b640f840b8dab68a3ec3883b2304e57c Mon Sep 17 00:00:00 2001 From: N-Nagorny Date: Thu, 21 Jul 2022 01:13:30 +0300 Subject: [PATCH] is_subconstraint(): fix the rational case --- Development/nmos/constraints.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Development/nmos/constraints.cpp b/Development/nmos/constraints.cpp index dbcac6f73..90a47c931 100644 --- a/Development/nmos/constraints.cpp +++ b/Development/nmos/constraints.cpp @@ -117,6 +117,10 @@ namespace nmos const auto& subconstraint_enum_values = nmos::fields::constraint_enum(subconstraint).as_array(); if (subconstraint_enum_values.end() == std::find_if(subconstraint_enum_values.begin(), subconstraint_enum_values.end(), [&constraint](const web::json::value& enum_value) { + if (enum_value.has_field(nmos::fields::numerator)) + { + return details::match_constraint(nmos::parse_rational(enum_value), constraint, [](const web::json::value& v) { return nmos::parse_rational(v); }); + } return details::match_constraint(enum_value, constraint, [](const web::json::value& v) { return v; }); })) {