Fix ui::edit numeric validators

This commit is contained in:
Nikita Lisitsa 2022-04-16 17:13:52 +03:00
parent 8d3c227285
commit 4b7221db26

View file

@ -70,14 +70,14 @@ namespace psemek::ui
if (begin != end && *begin == '-')
++begin;
return std::all_of(begin, end, [](char c){ return '0' <= c && c <= '9'; });
return std::all_of(begin, end, [](char32_t c){ return '0' <= c && c <= '9'; });
};
}
edit::validator_type edit::numeric_nonnegative()
{
return [](std::u32string_view const str) -> bool {
return std::all_of(str.begin(), str.end(), [](char c){ return '0' <= c && c <= '9'; });
return std::all_of(str.begin(), str.end(), [](char32_t c){ return '0' <= c && c <= '9'; });
};
}