diff options
Diffstat (limited to 'src/util/ranges.hpp')
-rw-r--r-- | src/util/ranges.hpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/util/ranges.hpp b/src/util/ranges.hpp deleted file mode 100644 index c47c7b5..0000000 --- a/src/util/ranges.hpp +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -#include <concepts> -#include <iterator> - -template <std::weakly_incrementable Value> -class IotaViewIterator -{ -public: - constexpr explicit IotaViewIterator(Value value) noexcept; - - constexpr auto operator++() noexcept -> const IotaViewIterator &; - constexpr auto operator++(int) noexcept -> IotaViewIterator; - - constexpr auto operator*() const noexcept -> Value; - - constexpr auto operator==(const IotaViewIterator &rhs) const noexcept -> bool; - constexpr auto operator!=(const IotaViewIterator &rhs) const noexcept -> bool; - -private: - Value _value; -}; - -/** - * A range factory that generates a sequence of elements by repeatedly incrementing an - * initial value. - * - * This class was created because C++20 ranges is a complete shitshow in Clang. - * https://github.com/llvm/llvm-project/issues/52696 - */ -template <std::weakly_incrementable Value, std::semiregular Bound> -requires std::equality_comparable_with<Value, Bound> && std::copyable<Value> -class IotaView -{ -public: - constexpr IotaView(Value value, Bound bound) noexcept; - - [[nodiscard]] constexpr auto begin() const noexcept -> IotaViewIterator<Value>; - - [[nodiscard]] constexpr auto end() const noexcept -> IotaViewIterator<Value>; - -private: - Value _value; - Bound _bound; -}; - -#include "ranges_impl.hpp" |