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