Skip to content
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

Make ThinVec::new constant #54

Open
schungx opened this issue Feb 1, 2024 · 2 comments
Open

Make ThinVec::new constant #54

schungx opened this issue Feb 1, 2024 · 2 comments

Comments

@schungx
Copy link

schungx commented Feb 1, 2024

I am not sure if there are any technical blockers on this... can ThinVec::new be made const?

Having to reinitialize every instance causes a very slight regression when I moved from Vec to ThinVec. I'd much rather it copies from pre-generated bits based on const.

@schungx
Copy link
Author

schungx commented Jul 6, 2024

Any chance to do this?

@zachs18
Copy link

zachs18 commented Aug 1, 2024

Since a single, shared static header is used for empty ThinVecs, having the current ThinVec::new be a const fn is only possible once Rust's const_refs_to_static feature becomes stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants