-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make SmallVec::new
const
#263
Comments
TimLuq
added a commit
to TimLuq/rust-smallvec
that referenced
this issue
Sep 24, 2021
TimLuq
added a commit
to TimLuq/rust-smallvec
that referenced
this issue
Sep 24, 2021
bors-servo
added a commit
that referenced
this issue
Sep 28, 2021
Added feature `const_new` which enables `SmallVec::new_const()` As I wasn't alone in finding a use for having a `const` version of `new` (see #263) I decided to make a PR for it. This adds a new feature flag `const_new` (nightly only) which exposes an alternative `new` function: `pub const unsafe fn new_const() -> SmallVec<A>`. Nightly is needed for the binding `A: Array`, which could be worked around if the strict requirement is dropped from the `struct` declarations and moved only to the existing `impl`s. If the maintainers wish for another solution for this I'll be happy to make a few more commits.
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I don't know if this is possible, but it would definitely be helpful!
The text was updated successfully, but these errors were encountered: