I feel like an implementation like impl<T, R> RangeBounds<T> for &'_ R where R: RangeBounds<T>
would be a nice QOL addition. It is trivial to implement because all methods of RangeBound
take &self
, and it would allow people to write fn foo(r: &impl RangeBounds<usize>)
. What do you think?
You can already implement RangeBounds<_>
for &'_ R
if you own R
, so the standard library adding that implementation would be a breaking change.
In more jargony terms, &
is fundamental, so that implementation is a blanket implementation.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.