diff --git a/src/memory.h b/src/memory.h index e52d801c..8178770f 100644 --- a/src/memory.h +++ b/src/memory.h @@ -69,7 +69,8 @@ namespace pkpy{ template shared_ptr make_shared(Args&&... args) { - static_assert(std::is_base_of::value, "U must be derived from T"); + static_assert(std::is_base_of_v, "U must be derived from T"); + static_assert(std::has_virtual_destructor_v, "T must have virtual destructor"); int* p = (int*)malloc(sizeof(int) + sizeof(U)); *p = 1; new(p+1) U(std::forward(args)...);