解决分配0字节空间时的问题
This commit is contained in:
1 parent
047f6ce937
commit
80f84a910d
1 file changed
+1
-1
+1
-1
@@ -40,7 +40,7 @@ namespace TinySTL{
|
|||||||
}
|
}
|
||||||
template<class T>
|
template<class T>
|
||||||
T *allocator<T>::allocate(size_t n){
|
T *allocator<T>::allocate(size_t n){
|
||||||
assert(n != 0);
|
if (n == 0) return 0;
|
||||||
return static_cast<T *>(alloc::allocate(sizeof(T) * n));
|
return static_cast<T *>(alloc::allocate(sizeof(T) * n));
|
||||||
}
|
}
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|||||||
Reference in new issue
Block a user