Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

pmr::polymorphic_allocator, scoped_allocator_adaptor, and uses_allocator #11

@AnabelSMRuggiero

Description

@AnabelSMRuggiero

Mark had mentioned earlier that supporting the memory resources in std::pmr was a hurdle that mdarray needed to get over;std::pmr::polymorphic_allocator follows the same scoped allocator model that is supported by std::scoped_allocator_adaptor and std::uses_allocator. Unless I'm missing something, the main things needed to fully support the scoped allocator model (when container_type::allocator_type exists) are:

  • Add a constructor to basic_mdarray that allows it to have an allocator passed in that passes the allocator to container_policy::create()
  • Support T(std::allocator_arg, alloc, size) as a possible container constructor and
  • Partial specialize std::uses_allocator to be based on basic_mdarray::container_type

I should be able to piece together most of a PR implementing uses allocator construction over the weekend.

Edit: got a bit ahead of myself and forgot that the relevant policy was specifically for vectors; supporting uses allocator construction for other containers would be the responsibility of the relevant policy.

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