From 4b7221db267454c49d90df3e59a2b2d729a3ed84 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 16 Apr 2022 17:13:52 +0300 Subject: [PATCH] Fix ui::edit numeric validators --- libs/ui/source/edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ui/source/edit.cpp b/libs/ui/source/edit.cpp index 7b43b313..179373f2 100644 --- a/libs/ui/source/edit.cpp +++ b/libs/ui/source/edit.cpp @@ -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'; }); }; }