diff --git a/CMakeLists.txt b/CMakeLists.txt index 98ba949..fbb076c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.17.27) +set(BLT_VERSION 0.17.28) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/std/ranges.h b/include/blt/std/ranges.h index 27d8683..5c48d87 100644 --- a/include/blt/std/ranges.h +++ b/include/blt/std/ranges.h @@ -19,6 +19,27 @@ namespace blt { namespace itr { + template + class itr_container + { + public: + itr_container(ITER&& begin, ITER&& end): begin_(std::forward(begin)), end_(std::forward(end)) + {} + + ITER begin() + { + return begin_; + } + + ITER end() + { + return end_; + } + + private: + ITER begin_, end_; + }; + template> class iterator; @@ -153,6 +174,12 @@ namespace blt return enumerator{container.begin(), container.end()}; } + template + static inline auto enumerate(ITER&& begin, ITER&& end) + { + return itr::itr_container{std::forward(begin), std::forward(end)}; + } + template struct range {