From 7307815e99a79dac42f2a9c06b0fe6171ea11ba0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 1 Jul 2022 16:01:04 +0200 Subject: refactor: use ranges --- src/util/ranges.hpp | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/util/ranges.hpp (limited to 'src/util/ranges.hpp') 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 -#include - -template -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 -requires std::equality_comparable_with && std::copyable -class IotaView -{ -public: - constexpr IotaView(Value value, Bound bound) noexcept; - - [[nodiscard]] constexpr auto begin() const noexcept -> IotaViewIterator; - - [[nodiscard]] constexpr auto end() const noexcept -> IotaViewIterator; - -private: - Value _value; - Bound _bound; -}; - -#include "ranges_impl.hpp" -- cgit v1.2.3-18-g5258