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 <tchaikov@gmail.com>
#include <array>
#include <cstring>
+#include <concepts>
#include <map>
#include <optional>
#include <set>
}
template<class It>
-concept is_const_iterator =
-std::is_const_v<std::remove_pointer_t<typename It::pointer>>;
+concept is_const_iterator = requires(It& it, size_t n) {
+ { it.get_pos_add(n) } -> std::same_as<const char*>;
+};
template<typename T, is_const_iterator It>
const T& get_pos_add(It& i) {