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
In my case, the allocator is just an empty struct that calls global functions, but it's not the global allocator. Having to pass Default::default() to every constructor is awkward. Is it possible to make the standard constructors like new, new_uninit etc available to non-standard allocators if the allocator implements Default? Then I can just do this:
typeMyBox<T> = Box<T,MyAllocator>;MyBox::new(foo)
The text was updated successfully, but these errors were encountered:
Unfortunately we can't make this change because it would break type inference for a huge portion of the ecosystem. This is the same reason why HashMap::new only works with the default hasher, even if you are using a custom hasher that implements Default.
In my case, the allocator is just an empty struct that calls global functions, but it's not the global allocator. Having to pass
Default::default()
to every constructor is awkward. Is it possible to make the standard constructors likenew
,new_uninit
etc available to non-standard allocators if the allocator implementsDefault
? Then I can just do this:The text was updated successfully, but these errors were encountered: