2
3
4
5
6
7
8
11#ifndef _MSTD_CONTAINERS_UTILS_HPP_
12 #define _MSTD_CONTAINERS_UTILS_HPP_
14 #include <mstd/config.hpp>
17_MSTD_WARNING(
"this is only available for c++17 and greater!");
20 #include <mstd/containers_libs.hpp>
22 #include <mstd/management_utils.hpp>
25 #pragma region IS_ITERATOR
27 template<
class T,
class =
void>
28 struct is_iterator : std::false_type {};
31 struct is_iterator<T, std::void_t<
typename std::iterator_traits<T>::iterator_category> > : std::true_type {};
37 template<
class T> concept iterator = is_iterator_v<T>;
41 #pragma region IS_ITERATOR_OF
43 template<
class Iter,
class T,
class =
void>
44 struct is_iterator_of : std::false_type {};
46 template<
class Iter,
class T>
47 struct is_iterator_of<Iter, T,
48 std::void_t<std::enable_if_t<is_iterator_v<Iter> &&
49 (std::is_convertible_v<
typename std::iterator_traits<Iter>::value_type, remove_cvref_t<T> > ||
50 std::is_same_v<
typename std::iterator_traits<Iter>::value_type, remove_cvref_t<T> >)> > >
53 template<
class Iter,
class T>
57 template<
class Iter,
class T> concept iterator_of = is_iterator_of_v<Iter, T>;
61 #pragma region IS_SAME_WITHOUT_CVREF
63 template<
class T,
class U>
64 struct is_same_without_cvref : std::is_same<remove_cvref_t<T>, remove_cvref_t<U> > {};
67 struct is_same_without_cvref<T, T> : std::true_type {};
69 template<
class T,
class U>
73 template<
class T,
class U> concept same_without_cvref_as = mstd::is_same_without_cvref_v<T, U>;
#define _MSTD_HAS_CXX17
Definition config.hpp:45
#define _MSTD_CONSTEXPR17
Definition config.hpp:76
#define _MSTD_HAS_CXX20
Definition config.hpp:52