From 98045a102c37b2e1901ad0a74c7378a18c8a48e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=93=E8=88=AA?= <1210603696@qq.com> Date: Wed, 24 Sep 2014 16:36:50 +0800 Subject: [PATCH] =?UTF-8?q?n=20=3D=3D=200=E6=97=B6=E4=B8=8D=E5=9B=9E?= =?UTF-8?q?=E6=94=B6=E5=86=85=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TinySTL/Allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }