Skip to content

Segfault on inserting function into std::pmr container #3

@jwt27

Description

@jwt27

The following code causes a segfault:

std::pmr::deque<func::function<void()>> functions { };
func::function<void()> f { [] { } };
functions.push_back(f);

However, creating a single function with the pmr allocator does not:

func::function<void()> f { std::allocator_arg, std::pmr::polymorphic_allocator<> { }, [] { } };

And this also works:

functions.push_back([] { });

Possibly related to #2 somehow, but std::pmr::polymorphic_allocator has no virtual destructor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions