-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi, thanks for this great header, I still use this because of its allocator support. However I just now discovered that it chokes when given an allocator that has a base with virtual destructor.
The following code consistently segfaults upon calling the allocator dtor in templated_call_move_and_destroy():
#include <function.h>
struct A { virtual ~A() { } };
template <typename T = std::byte>
struct Alloc : A
{
T* allocate(std::size_t) { return nullptr; }
void deallocate(T*) { }
};
int main()
{
func::function<int()> f { std::allocator_arg, Alloc<> { }, [] { return 0; } };
return f();
}
Metadata
Metadata
Assignees
Labels
No labels