Closed richard-uk1 closed 4 years ago
Just out of interest, how will the new collections in std work? Will they take an allocator? Is there some documentation I can read?
Just out of interest, how will the new collections in std work? Will they take an allocator? Is there some documentation I can read?
It isn't 100% clear yet (will probably require a new RFC to sort it all out) but the few bits of std::collections
that are parameterised over an allocator have additional constructors for passing the allocator in by reference.
Aa I see, so we can replace this when the time comes. I'll just do the tidying up you've suggested.
Going to close this due to inactivity -- @derekdreery if you want to rebase and do the tidying up mentioned above, I'll be happy to reopen and merge in the future!
This adds an extension trait for a new iterator method
collect_in
, that allows usingcollect
on a bump allocator.I've made the PR to stimulate discussion, it didn't take very long so feel free to reject if you feel it doesn't fit.