Skip to content

value_to object with stateful allocator such as std::pmr::string #854

@star-e

Description

@star-e

How can we construct a std::pmr::string using value_to, with user-provided std::pmr::memory_resource*?
Here, the object and the json value are using different memory_resource sources.

The customization function's signature is T tag_invoke( const value_to_tag< T >&, const value& ), which does not take any Allocator as parameter. So there is no way to provide the allocator.

It seems we can only construct std::pmr::string from std::pmr::get_default_resource()?

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