From e912e7e2727f107eb10580e11da4961f61f2203d Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 9 Nov 2023 19:11:56 -0500 Subject: [PATCH] ranges --- include/blt/std/memory.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/include/blt/std/memory.h b/include/blt/std/memory.h index f36668d..adfc648 100755 --- a/include/blt/std/memory.h +++ b/include/blt/std/memory.h @@ -106,7 +106,7 @@ namespace blt struct range_itr { private: - const T current; + T current; public: using iterator_category = std::bidirectional_iterator_tag; using difference_type = T; @@ -163,7 +163,22 @@ namespace blt template struct range { - + private: + T _begin; + T _end; + public: + range(T begin, T end): _begin(begin), _end(end) + {} + + range_itr begin() + { + return range_itr{_begin}; + } + + range_itr end() + { + return range_itr{_end}; + } }; template