Open danakj opened 10 months ago
My brain came up with an answer here this morning.
define concepts that match the shape of std containers, like a ReservePushBackContainer for vector. Then provide from_iter impls for those concepts beside the FromIterator concept.
Collapse these headers or include them from the concept-defining location?
But we don't want to include every container header from the to be true and others see it to be false. The compiler can cache the answer and get false everywhere unexpectedly.
from_iterator.h
header. However it's real bad if some places see FromIteratorThe right thing to do is to ensure the concept knows the right answer where the concept is defined, or where the std::vector (etc) type is defined. We can't do the latter so... how do we do the former?
Or, once sus::Vec is backed by std::vector do we just say you'd? That feels bad though. It would be better to
it.collect<sus::Vec<T>>()
and then you can convert for ~free to std::vectorit.collect<std::vector<T>>()
.Notably we avoided this issue for option/result and numerics, so this does not block the numerics milestone.