diff --git a/TinySTL/Allocator.h b/TinySTL/Allocator.h index b12e18c..68d9d25 100644 --- a/TinySTL/Allocator.h +++ b/TinySTL/Allocator.h @@ -49,7 +49,7 @@ namespace TinySTL{ } template void allocator::deallocate(T *ptr, size_t n){ - assert(n != 0); + if (n == 0) return; alloc::deallocate(static_cast(ptr), sizeof(T)* n); }