Skip to content

construct() and destroy() should work without uses_allocator, with local storage #6

@potswa

Description

@potswa

Currently is_small disables local storage according to std::uses_allocator. If uses_allocator returns false_type and local storage is applied, then construct and destroy don't get called.

Instead, construct and destroy should be applied to the local storage. A copy of the allocator needs to be saved to call destroy, but hopefully this can be avoided.

Detect whether the allocator actually implements destroy; if not, use ordinary destruction.

If the allocator is scoped_allocator_adaptor and get_allocator() works on the target, then it would be nice to use that for destruction. But, that would be too presumptuous. It might be OK to check for implementation of destroy on scoped_allocator_adaptor::outer_allocator_type. A more generic means would be nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions