thin-vec icon indicating copy to clipboard operation
thin-vec copied to clipboard

Make ThinVec::new constant

Open schungx opened this issue 1 year ago • 2 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.

schungx avatar Feb 01 '24 01:02 schungx

Any chance to do this?

schungx avatar Jul 06 '24 04:07 schungx

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.

zachs18 avatar Aug 01 '24 06:08 zachs18