-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add const-erased versions of the various containers #371
Comments
Types:
|
There are cases where some adjacent structures have the const generic that could be removed thanks to this implementation. Would it be worth making breaking changes to remove this const generic? |
Making code flexible around heapless structures can be a bit verbose because it requires being generic over the capacity of each collection. This could be helped by providing versions of the structures with the
const
erased. This would allow removing the generics in some cases.For example,
heapless::Vec
currently is :It should be possible to provide a struct that goes hand in hand with it:
With
VecView
implementing most of the API that Vec currently implements. This would allow for example methods that write data to an outbuffer of type&mut Vec<T, N>
to instead take a parameterVecView<'_, T>
.Something like:
could become
In a trait for example this would also have the advantage of making it object-safe.
I believe this pattern:
The text was updated successfully, but these errors were encountered: