You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to add a new-like function that is const? It would be useful to create static maps without the aid of something like once_cell.
From scanning the code, it seems like with_hasher is maybe the right function to make const, since you don't have to make a hasher (it's given) and "no allocation" is already in the spec for that function.
The text was updated successfully, but these errors were encountered:
A PR is welcome! I think with_hasher is the only constructor we can support. For precedent, the standard HashMap doesn't have any constant functions, but hashbrown does have constant with_hasher in its own map and set.
For other methods, Vec and/or RawTable don't give us anything else to work with, not even len.
Would it be possible to add a
new
-like function that isconst
? It would be useful to create static maps without the aid of something likeonce_cell
.From scanning the code, it seems like
with_hasher
is maybe the right function to makeconst
, since you don't have to make a hasher (it's given) and "no allocation" is already in the spec for that function.The text was updated successfully, but these errors were encountered: