6 ms·
> putting the record data right after the CacheEntry members I assumed they couldn't do that because they're using it with some kind of generic HashMap<K, V>.
by cakoose 21d ago
> putting the record data right after the CacheEntry members
I assumed they couldn't do that because they're using it with some kind of generic HashMap<K, V>. In that situation, can "V" be dynamically sized?
A dynamically sized "V" would mean you can't have an array of them, which might preclude some hash map implementations.
- esterna 21d ago> All type parameters have an implicit bound of Sized. The special syntax ?Sized can be used to remove this bound if it’s not appropriate. , which HashMap does not do, i.e. the keys and values have to have a statically known size.
- deleted 21d ago[deleted]