From: Kefu Chai Date: Sun, 21 Aug 2022 00:23:00 +0000 (+0800) Subject: include/denc: redefine is_const_iterator X-Git-Tag: v18.0.0~195^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3fd12ff38ddfea869331bfec439307f2315ff11d;p=ceph.git 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 --- diff --git a/src/include/denc.h b/src/include/denc.h index 96b7e7c099fc..b8982fa2110d 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) {