5 #ifndef VCCC_ITERATOR_INCREMENTABLE_TRAITS_HPP_
6 #define VCCC_ITERATOR_INCREMENTABLE_TRAITS_HPP_
10 #include <type_traits>
20 struct substract_check : std::false_type {};
23 struct substract_check<T, true> : std::is_integral<decltype(std::declval<const T&>() - std::declval<const T&>())> {};
27 struct incrementable_traits_subtractable {
28 using difference_type = std::make_signed_t<decltype(std::declval<T>() - std::declval<T>())>;
32 struct incrementable_traits_no_difference_type
34 substract_check<T>::value,
35 incrementable_traits_subtractable<T>,
40 struct incrementable_traits_yes_difference_type {
41 using difference_type =
typename T::difference_type;
45 struct incrementable_traits_impl
47 has_typename_difference_type<T>::value,
48 incrementable_traits_yes_difference_type<T>,
49 incrementable_traits_no_difference_type<T>
53 struct incrementable_traits_object_pointer {
54 using difference_type = std::ptrdiff_t;
58 struct incrementable_traits_impl<T*>
61 incrementable_traits_object_pointer<T>,
65 #if __cplusplus < 202002L
67 struct incrementable_traits_impl<
std::back_insert_iterator<T>> {
68 using difference_type = std::ptrdiff_t;
72 struct incrementable_traits_impl<
std::front_insert_iterator<T>> {
73 using difference_type = std::ptrdiff_t;
77 struct incrementable_traits_impl<
std::insert_iterator<T>> {
78 using difference_type = std::ptrdiff_t;
82 struct incrementable_traits_impl<
std::ostream_iterator<T>> {
83 using difference_type = std::ptrdiff_t;
87 struct incrementable_traits_impl<
std::ostreambuf_iterator<T>> {
88 using difference_type = std::ptrdiff_t;
118 struct incrementable_traits;
constexpr VCCC_INLINE_OR_STATIC detail::empty_niebloid empty
checks whether a range is empty
Definition: empty.hpp:116
Definition: matrix.hpp:495
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
computes the difference type of a weakly_incrementable type
Definition: incrementable_traits.hpp:123