From 3fd12ff38ddfea869331bfec439307f2315ff11d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 21 Aug 2022 08:23:00 +0800 Subject: [PATCH] include/denc: redefine is_const_iterator to just check for the return type of `it.get_pos_add(n)`, this is exactly what we expect from a buffer::ptr::const_iterator. it is more specific and less confusing. Signed-off-by: Kefu Chai --- src/include/denc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/include/denc.h b/src/include/denc.h index 96b7e7c099f..b8982fa2110 100644 --- a/src/include/denc.h +++ b/src/include/denc.h @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -283,8 +284,9 @@ using underlying_type_t = typename underlying_type::type; } template -concept is_const_iterator = -std::is_const_v>; +concept is_const_iterator = requires(It& it, size_t n) { + { it.get_pos_add(n) } -> std::same_as; +}; template const T& get_pos_add(It& i) { -- 2.39.5