aboutsummaryrefslogtreecommitdiff
path: root/src/util/ranges.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-07-01 16:01:04 +0200
committerHampusM <hampus@hampusmat.com>2022-07-01 16:01:04 +0200
commit7307815e99a79dac42f2a9c06b0fe6171ea11ba0 (patch)
treead41ee819dc87fc2653caf720fa7d1df30c0caeb /src/util/ranges.hpp
parent2bff8c999edde11270ecaf6fbd2d24f54d0e360b (diff)
refactor: use ranges
Diffstat (limited to 'src/util/ranges.hpp')
-rw-r--r--src/util/ranges.hpp47
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"