diff --git a/include/cxx.h b/include/cxx.h index 3414e4c8a..dc1420da1 100644 --- a/include/cxx.h +++ b/include/cxx.h @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include #include #include @@ -217,6 +218,7 @@ template class Slice::iterator final { public: using iterator_category = std::random_access_iterator_tag; + using iterator_concept = std::contiguous_iterator_tag; using value_type = T; using difference_type = std::ptrdiff_t; using pointer = typename std::add_pointer::type; @@ -244,6 +246,10 @@ class Slice::iterator final { bool operator>(const iterator &) const noexcept; bool operator>=(const iterator &) const noexcept; + template + friend iterator operator+(N n, const iterator& it) noexcept { + return it + n; + } private: friend class Slice; void *pos;