Skip to content

Suggestion: allow the constructors without _in for allocator types that implement Default #127

@Rua

Description

@Rua

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:

type MyBox<T> = Box<T, MyAllocator>;
MyBox::new(foo)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions