25#ifndef ENUMERATECONTRIBTW_H
26#define ENUMERATECONTRIBTW_H
51 using value_type = std::pair<nested_reference, std::size_t>;
69 template <
typename OIt>
71 ->
decltype(std::declval<It&>() == std::declval<OIt&>()) {
74 template <
typename OIt>
76 ->
decltype(std::declval<It&>() != std::declval<OIt&>()) {
82 return lhs.it == rhs.it;
86 return lhs.it != rhs.it;
90template <
typename Range,
typename =
void>
100template <
typename Range>
104 using range_t =
typename std::remove_reference_t<Range>;
113 constexpr auto begin() const& noexcept(noexcept(r.cbegin()))
115 return {r.cbegin(), 0};
118 return {r.begin(), 0};
122 return {r.cend(), -std::size_t{1}};
125 return {r.end(), -std::size_t{1}};
136template <
typename It,
typename EndIt>
145 return {r_end, -std::size_t{1}};
158template <
typename Range>
160 return {std::forward<Range>(r)};
168template <
typename It,
typename EIt>
typename no_dangle< T >::type no_dangle_t
constexpr auto enumerate(It begin, EIt end) -> enumerate_t< It, EIt >
Allow access to indexes while using range-based for loops.
std::ptrdiff_t difference_type
constexpr auto operator==(OIt rhs) -> decltype(std::declval< It & >()==std::declval< OIt & >())
constexpr auto operator++() &-> enumerate_iterator &
constexpr auto operator++(int) -> enumerate_iterator
constexpr friend auto operator==(enumerate_iterator lhs, enumerate_iterator rhs) -> bool
constexpr auto operator*() -> value_type
constexpr auto operator!=(OIt rhs) -> decltype(std::declval< It & >() !=std::declval< OIt & >())
std::pair< nested_reference, std::size_t > value_type
constexpr friend auto operator!=(enumerate_iterator lhs, enumerate_iterator rhs) -> bool
typename std::iterator_traits< It >::reference nested_reference
std::input_iterator_tag iterator_category
constexpr auto end() const &noexcept(noexcept(r.cend())) -> const_iterator
decltype(r.end()) nested_end_iterator
decltype(r.begin()) nested_iterator
typename range_t::const_iterator nested_const_iterator
constexpr auto begin() &noexcept(noexcept(r.begin())) -> iterator
constexpr auto begin() const &noexcept(noexcept(r.cbegin())) -> const_iterator
typename std::remove_reference_t< Range > range_t
constexpr auto end() &noexcept(noexcept(r.end())) -> end_iterator
detail::no_dangle_t< Range > r
constexpr auto end() const &noexcept -> end_iterator
constexpr auto begin() const &noexcept -> iterator
Provides macros and basic templates used by the rest of kblib.