diff --git a/cruft/util/concepts.hpp b/cruft/util/concepts.hpp index 65dd727b..af9f9359 100644 --- a/cruft/util/concepts.hpp +++ b/cruft/util/concepts.hpp @@ -53,13 +53,19 @@ namespace cruft::concepts { /// Anything that can be looped over using begin/end + /// + /// We don't check end against legacy_iterator because that won't work for std::default_sentinel. + /// Rather, the important part is that it's equality comparable against whatever std::begin returns. template concept iterable = requires (T t) { { std::begin (t) } -> named::legacy_iterator; - { std::end (t) } -> named::legacy_iterator; + std::begin (t) == std::end (t); + std::begin (t) != std::end (t); + { std::cbegin (t) } -> named::legacy_iterator; - { std::cend (t) } -> named::legacy_iterator; + std::cbegin (t) == std::cend (t); + std::cbegin (t) != std::cend (t); };