You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Collapse these headers or include them from the concept-defining location?
But we don't want to include every container header from the from_iterator.h header. However it's real bad if some places see FromIteratorstd::vector to be true and others see it to be false. The compiler can cache the answer and get false everywhere unexpectedly.
The 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 it.collect<sus::Vec<T>>() and then you can convert for ~free to std::vector? That feels bad though. It would be better to it.collect<std::vector<T>>().
Notably we avoided this issue for option/result and numerics, so this does not block the numerics milestone.
The text was updated successfully, but these errors were encountered:
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
from_iterator.h
header. However it's real bad if some places see FromIteratorstd::vector to be true and others see it to be false. The compiler can cache the answer and get false everywhere unexpectedly.The 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
it.collect<sus::Vec<T>>()
and then you can convert for ~free to std::vector? That feels bad though. It would be better toit.collect<std::vector<T>>()
.Notably we avoided this issue for option/result and numerics, so this does not block the numerics milestone.
The text was updated successfully, but these errors were encountered: