diff --git a/octa/array.h b/octa/array.h index dd5894e..8df439d 100644 --- a/octa/array.h +++ b/octa/array.h @@ -25,8 +25,6 @@ struct Array { using ConstPointer = const T *; using Range = octa::PointerRange; using ConstRange = octa::PointerRange; - using ReverseRange = octa::ReverseRange; - using ConstReverseRange = octa::ReverseRange; T &operator[](Size i) { return p_buf[i]; } const T &operator[](Size i) const { return p_buf[i]; } @@ -63,16 +61,6 @@ struct Array { return ConstRange(p_buf, p_buf + N); } - ReverseRange reach() { - return each().reach(); - } - ConstReverseRange reach() const { - return each().reach(); - } - ConstReverseRange creach() const { - return ceach().reach(); - } - void swap(Array &v) { octa::swap_ranges(each(), v.each()); } diff --git a/octa/initializer_list.h b/octa/initializer_list.h index 15b941c..c3a1e5a 100644 --- a/octa/initializer_list.h +++ b/octa/initializer_list.h @@ -48,20 +48,6 @@ octa::PointerRange ceach(std::initializer_list init) { return octa::PointerRange(init.begin(), init.end()); } -template -octa::ReverseRange> -reach(std::initializer_list init) { - return octa::ReverseRange>(init.begin(), - init.end()); -} - -template -octa::ReverseRange> -ceach(std::initializer_list init) { - return octa::ReverseRange>(init.begin(), - init.end()); -} - } #endif \ No newline at end of file diff --git a/octa/range.h b/octa/range.h index 62af657..42d9e9f 100644 --- a/octa/range.h +++ b/octa/range.h @@ -42,6 +42,8 @@ OCTA_RANGE_TRAIT(Size, Size) OCTA_RANGE_TRAIT(Value, Value) OCTA_RANGE_TRAIT(Reference, Reference) OCTA_RANGE_TRAIT(Difference, Difference) +OCTA_RANGE_TRAIT(Reverse, Reverse) +OCTA_RANGE_TRAIT(Movable, Movable) #undef OCTA_RANGE_TRAIT @@ -301,6 +303,8 @@ template; + using Movable = MoveRange; octa::detail::RangeIterator begin() const { return octa::detail::RangeIterator((const B &)*this); @@ -329,17 +333,17 @@ template reach() const { + ReverseRange reverse() const { return ReverseRange(each()); } - RangeHalf half() const { - return RangeHalf(each()); - } - MoveRange movable() const { return MoveRange(each()); } + + RangeHalf half() const { + return RangeHalf(each()); + } }; template @@ -357,21 +361,6 @@ auto ceach(const T &r) -> decltype(r.each()) { return r.each(); } -template -auto reach(T &r) -> decltype(r.reach()) { - return r.reach(); -} - -template -auto reach(const T &r) -> decltype(r.reach()) { - return r.reach(); -} - -template -auto creach(const T &r) -> decltype(r.reach()) { - return r.reach(); -} - template struct OutputRange { @@ -769,11 +758,6 @@ PointerRange each(T (&array)[N]) { return PointerRange(array, N); } -template -ReverseRange> reach(T (&array)[N]) { - return ReverseRange>(PointerRange(array, N)); -} - template struct EnumeratedValue { S index; diff --git a/octa/string.h b/octa/string.h index bdbf096..81b6d10 100644 --- a/octa/string.h +++ b/octa/string.h @@ -149,8 +149,6 @@ public: using ConstPointer = const T *; using Range = octa::StringRangeBase; using ConstRange = octa::StringRangeBase; - using ReverseRange = octa::ReverseRange; - using ConstReverseRange = octa::ReverseRange; using Allocator = A; StringBase(const A &a = A()): p_buf(1, '\0', a) {} @@ -300,16 +298,6 @@ public: return ConstRange(p_buf.data(), size()); } - ReverseRange reach() { - return each().reach(); - } - ConstReverseRange reach() const { - return each().reach(); - } - ConstReverseRange creach() const { - return ceach().reach(); - } - void swap(StringBase &v) { p_buf.swap(v); } diff --git a/octa/vector.h b/octa/vector.h index 0c0ca82..76218bb 100644 --- a/octa/vector.h +++ b/octa/vector.h @@ -127,8 +127,6 @@ public: using ConstPointer = const T *; using Range = octa::PointerRange; using ConstRange = octa::PointerRange; - using ReverseRange = octa::ReverseRange; - using ConstReverseRange = octa::ReverseRange; using Allocator = A; Vector(const A &a = A()): p_buf(nullptr, a), p_len(0), p_cap(0) {} @@ -417,16 +415,6 @@ public: return ConstRange(p_buf.p_ptr, p_buf.p_ptr + p_len); } - ReverseRange reach() { - return each().reach(); - } - ConstReverseRange reach() const { - return each().reach(); - } - ConstReverseRange creach() const { - return ceach().reach(); - } - void swap(Vector &v) { octa::swap(p_len, v.p_len); octa::swap(p_cap, v.p_cap);