patch ranges

v1
Brett 2024-07-02 13:13:13 -04:00
parent 4776546e35
commit 5e65416684
2 changed files with 10 additions and 9 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.20) cmake_minimum_required(VERSION 3.20)
include(cmake/color.cmake) include(cmake/color.cmake)
set(BLT_VERSION 0.17.28) set(BLT_VERSION 0.17.29)
set(BLT_TEST_VERSION 0.0.1) set(BLT_TEST_VERSION 0.0.1)
set(BLT_TARGET BLT) set(BLT_TARGET BLT)

View File

@ -19,25 +19,26 @@ namespace blt
{ {
namespace itr namespace itr
{ {
template<typename ITER> template<typename Begin, typename End>
class itr_container class itr_container
{ {
public: public:
itr_container(ITER&& begin, ITER&& end): begin_(std::forward<ITER>(begin)), end_(std::forward<ITER>(end)) itr_container(Begin&& begin, End&& end): begin_(std::forward<Begin>(begin)), end_(std::forward<End>(end))
{} {}
ITER begin() Begin begin()
{ {
return begin_; return begin_;
} }
ITER end() End end()
{ {
return end_; return end_;
} }
private: private:
ITER begin_, end_; Begin begin_;
End end_;
}; };
template<typename TYPE_ITR, bool is_ptr = std::is_pointer_v<TYPE_ITR>> template<typename TYPE_ITR, bool is_ptr = std::is_pointer_v<TYPE_ITR>>
@ -174,10 +175,10 @@ namespace blt
return enumerator{container.begin(), container.end()}; return enumerator{container.begin(), container.end()};
} }
template<typename ITER> template<typename Begin, typename End>
static inline auto enumerate(ITER&& begin, ITER&& end) static inline auto enumerate(Begin&& begin, End&& end)
{ {
return itr::itr_container<ITER>{std::forward<ITER>(begin), std::forward<ITER>(end)}; return itr::itr_container<Begin, End>{std::forward<Begin>(begin), std::forward<End>(end)};
} }
template<typename T> template<typename T>