From 6408e8f3b40116255bd6bc526fab70be05340c5a Mon Sep 17 00:00:00 2001 From: sha512sum Date: Fri, 28 Jun 2024 05:09:18 +0000 Subject: [PATCH] Use std::ranges::subrange istead custom impl --- include/cserver/engine/components.hpp | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/include/cserver/engine/components.hpp b/include/cserver/engine/components.hpp index b89453b..445625e 100644 --- a/include/cserver/engine/components.hpp +++ b/include/cserver/engine/components.hpp @@ -373,25 +373,6 @@ struct CompileTimeStack { return std::move(*this->data[tmp]); }; }; - -template -struct RangeView { - T* beginIterator; - T* endIterator; - template - inline constexpr auto begin(this Self&& self) { - return std::forward(self).beginIterator; - }; - template - inline constexpr auto end(this Self&& self) { - return std::forward(self).endIterator; - }; - inline constexpr RangeView(std::ranges::range auto&& range) : - beginIterator(std::ranges::begin(range)), - endIterator(std::ranges::end(range)) {}; -}; -RangeView(std::ranges::range auto&& range) -> RangeView>; - } // namespace impl template @@ -409,7 +390,7 @@ consteval auto TopologicalSort(const DependencyGraph; const std::array adj = utempl::Map(storage, [](std::ranges::range auto& arg){ - return impl::RangeView{arg}; + return std::ranges::subrange(arg.data(), arg.data() + arg.size()); }, utempl::kType>); std::array visited{}; constexpr auto ResultSize = sizeof...(Dependencies);