parker is being annoying

v1
Brett 2024-09-24 20:35:43 -04:00
parent a7412fccec
commit 88506e5cce
3 changed files with 37 additions and 15 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20) cmake_minimum_required(VERSION 3.20)
include(cmake/color.cmake) include(cmake/color.cmake)
set(BLT_VERSION 0.20.24) set(BLT_VERSION 0.20.25)
set(BLT_TEST_VERSION 0.0.1) set(BLT_TEST_VERSION 0.0.1)
set(BLT_TARGET BLT) set(BLT_TARGET BLT)

View File

@ -24,21 +24,43 @@
namespace blt::meta namespace blt::meta
{ {
// this is required! :/
template<typename Iter> template<typename Iter>
constexpr bool is_input_iterator = std::is_same_v<typename std::iterator_traits<Iter>::iterator_cateogry, std::input_iterator_tag>; struct is_input_iterator {
constexpr static bool value = std::is_same_v<typename std::iterator_traits<Iter>::iterator_category, std::input_iterator_tag>;
};
template<typename Iter> template<typename Iter>
constexpr bool is_forward_iterator = std::is_same_v<typename std::iterator_traits<Iter>::iterator_cateogry, std::forward_iterator_tag>; struct is_forward_iterator {
constexpr static bool value = std::is_same_v<typename std::iterator_traits<Iter>::iterator_category, std::forward_iterator_tag>;
};
template<typename Iter> template<typename Iter>
constexpr bool is_bidirectional_iterator = std::is_same_v<typename std::iterator_traits<Iter>::iterator_cateogry, std::bidirectional_iterator_tag>; struct is_bidirectional_iterator {
constexpr static bool value = std::is_same_v<typename std::iterator_traits<Iter>::iterator_category, std::bidirectional_iterator_tag>;
};
template<typename Iter> template<typename Iter>
constexpr bool is_random_access_iterator = std::is_same_v<typename std::iterator_traits<Iter>::iterator_cateogry, std::random_access_iterator_tag>; struct is_random_access_iterator {
constexpr static bool value = std::is_same_v<typename std::iterator_traits<Iter>::iterator_category, std::random_access_iterator_tag>;
};
template<typename Iter> template<typename Iter>
constexpr bool is_bidirectional_or_better = is_bidirectional_iterator<Iter> || is_random_access_iterator<Iter>; inline constexpr bool is_input_iterator_v = is_input_iterator<Iter>::value;
template<typename Iter>
inline constexpr bool is_forward_iterator_v = is_forward_iterator<Iter>::value;
template<typename Iter>
inline constexpr bool is_bidirectional_iterator_v = is_bidirectional_iterator<Iter>::value;
template<typename Iter>
inline constexpr bool is_random_access_iterator_v = is_random_access_iterator<Iter>::value;
template<typename Iter>
inline constexpr bool is_bidirectional_or_better_v = is_bidirectional_iterator_v<Iter> || is_random_access_iterator_v<Iter>;
} }
#endif //BLT_META_ITERATOR_H #endif //BLT_META_ITERATOR_H

View File

@ -109,7 +109,7 @@ namespace blt
class enumerate_wrapper; class enumerate_wrapper;
template<typename Iter> template<typename Iter>
class enumerate_wrapper<Iter, std::enable_if_t<blt::meta::is_forward_iterator<Iter>, std::void_t<std::forward_iterator_tag>>> class enumerate_wrapper<Iter, std::enable_if_t<blt::meta::is_forward_iterator_v<Iter>, std::void_t<std::forward_iterator_tag>>>
: public enumerate_forward_iterator<Iter> : public enumerate_forward_iterator<Iter>
{ {
public: public:
@ -124,7 +124,7 @@ namespace blt
}; };
template<typename Iter> template<typename Iter>
class enumerate_wrapper<Iter, std::enable_if_t<blt::meta::is_bidirectional_or_better<Iter>, std::void_t<std::bidirectional_iterator_tag>>> class enumerate_wrapper<Iter, std::enable_if_t<blt::meta::is_bidirectional_or_better_v<Iter>, std::void_t<std::bidirectional_iterator_tag>>>
: public enumerate_bidirectional_iterator<Iter> : public enumerate_bidirectional_iterator<Iter>
{ {
public: public:
@ -172,8 +172,8 @@ namespace blt
{} {}
explicit enumerator_reversible(Iter begin, Iter end, blt::size_t begin_index, blt::size_t end_index): explicit enumerator_reversible(Iter begin, Iter end, blt::size_t begin_index, blt::size_t end_index):
enumerator_base<Iter, IterWrapper>(IterWrapper(std::move(begin), begin_index), enumerator_base<Iter, IterWrapper>(IterWrapper{enumerate_wrapper<Iter>(std::move(begin), begin_index)},
IterWrapper(std::move(end), end_index)), IterWrapper{enumerate_wrapper<Iter>(std::move(end), end_index)}),
container_size(std::abs(static_cast<blt::ptrdiff_t>(end_index) - static_cast<blt::ptrdiff_t>(begin_index))) container_size(std::abs(static_cast<blt::ptrdiff_t>(end_index) - static_cast<blt::ptrdiff_t>(begin_index)))
{} {}
@ -193,7 +193,7 @@ namespace blt
class enumerator_rev; class enumerator_rev;
template<typename Iter> template<typename Iter>
class enumerator<Iter, std::enable_if_t<blt::meta::is_forward_iterator<Iter>, std::void_t<std::forward_iterator_tag>>> class enumerator<Iter, std::enable_if_t<blt::meta::is_forward_iterator_v<Iter>, std::void_t<std::forward_iterator_tag>>>
: public enumerator_base<Iter, enumerate_wrapper<Iter>> : public enumerator_base<Iter, enumerate_wrapper<Iter>>
{ {
public: public:
@ -201,7 +201,7 @@ namespace blt
}; };
template<typename Iter> template<typename Iter>
class enumerator<Iter, std::enable_if_t<blt::meta::is_bidirectional_iterator<Iter>, std::void_t<std::bidirectional_iterator_tag>>> class enumerator<Iter, std::enable_if_t<blt::meta::is_bidirectional_iterator_v<Iter>, std::void_t<std::bidirectional_iterator_tag>>>
: public enumerator_reversible<Iter, enumerate_wrapper<Iter>, enumerator_rev<Iter>> : public enumerator_reversible<Iter, enumerate_wrapper<Iter>, enumerator_rev<Iter>>
{ {
public: public:
@ -209,7 +209,7 @@ namespace blt
}; };
template<typename Iter> template<typename Iter>
class enumerator<Iter, std::enable_if_t<blt::meta::is_random_access_iterator<Iter>, std::void_t<std::random_access_iterator_tag>>> class enumerator<Iter, std::enable_if_t<blt::meta::is_random_access_iterator_v<Iter>, std::void_t<std::random_access_iterator_tag>>>
: public enumerator_reversible<Iter, enumerate_wrapper<Iter>, enumerator_rev<Iter>> : public enumerator_reversible<Iter, enumerate_wrapper<Iter>, enumerator_rev<Iter>>
{ {
public: public:
@ -217,7 +217,7 @@ namespace blt
}; };
template<typename Iter> template<typename Iter>
class enumerator_rev<Iter, std::enable_if_t<blt::meta::is_bidirectional_iterator<Iter>, std::void_t<std::bidirectional_iterator_tag>>> class enumerator_rev<Iter, std::enable_if_t<blt::meta::is_bidirectional_iterator_v<Iter>, std::void_t<std::bidirectional_iterator_tag>>>
: public enumerator_reversible<Iter, std::reverse_iterator<enumerate_wrapper<Iter>>, enumerator<Iter>> : public enumerator_reversible<Iter, std::reverse_iterator<enumerate_wrapper<Iter>>, enumerator<Iter>>
{ {
public: public:
@ -225,7 +225,7 @@ namespace blt
}; };
template<typename Iter> template<typename Iter>
class enumerator_rev<Iter, std::enable_if_t<blt::meta::is_random_access_iterator<Iter>, std::void_t<std::random_access_iterator_tag>>> class enumerator_rev<Iter, std::enable_if_t<blt::meta::is_random_access_iterator_v<Iter>, std::void_t<std::random_access_iterator_tag>>>
: public enumerator_reversible<Iter, std::reverse_iterator<enumerate_wrapper<Iter>>, enumerator<Iter>> : public enumerator_reversible<Iter, std::reverse_iterator<enumerate_wrapper<Iter>>, enumerator<Iter>>
{ {
public: public: