Concept Subspace :: sus :: iter :: Sum

template <class T, class Item = T>
concept Sum
requires
requires(__private::IteratorArchetype<Item>&& iter) {
  // Use cloned() or copied() to convert an Iterator of references to values.
  requires(!std::is_reference_v<T>);
  { T::from_sum(::sus::move(iter)) } -> std::same_as<T>;
}

Trait to represent types that can be created by adding elements of an iterator.

Types which implement this trait can be generated by using the sum() method on an iterator. Like with FromIterator, the from_sum() method should rarely be called directly.

When given an empty iterator, the result of from_sum() should be the "zero" value of the type.