Concept Subspace :: sus :: iter :: IntoIterator

template <class T, class Item>
concept IntoIterator
requires
requires(std::remove_cvref_t<T> t) {
  { ::sus::move(t).into_iter() } -> Iterator<Item>;
}

Conversion into an Iterator.

A more general trait than Iterator which will accept anything that can be iterated, including an Iterator (since all Iterators also satisfy IntoIterator). This can be particularly useful when receiving an iterator over a set of non-reference values, allowing the caller to pass a collection directly in place of an iterator.

Note that an IntoIterator type is not directly iterable in for loops, and requires calling into_iter() on it to convert it into an Iterator which is iterable in for loops.