Gankra / thin-vec

A Vec That Has a Smaller size_of

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make ThinVec::new constant

schungx opened this issue · comments

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.

Any chance to do this?

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.