chromium / subspace

A concept-centered standard library for C++20, enabling safer and more reliable products and a more modern feel for C++ code.; Also home of Subdoc the code-documentation generator.
https://suslib.cc
Apache License 2.0
89 stars 15 forks source link

Make std::ranges be IntoIterator #348

Open danakj opened 1 year ago

danakj commented 1 year ago

To do this, we need to be able to implement IntoIterator for any type. That means it can't be a structural concept, but needs to be done through template specialization or whatever.

We should keep the into_iter() methods on types that are IntoIterator for convenience when you have the concrete type, but generic code would want to sus::iter::into_iter(x) instead. Then it can do so on a std::range.

Then sus::iter::from_range() can go away.