Przeglądaj źródła

Merge pull request #352 from Dmitry-Me/consistencyAsserts

Consistency asserts
Lee Thomason 10 lat temu
rodzic
commit
73f08a3185
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      tinyxml2.h

+ 3 - 0
tinyxml2.h

@@ -253,14 +253,17 @@ public:
     }
 
     int Capacity() const				{
+        TIXMLASSERT( _allocated >= INITIAL_SIZE );
         return _allocated;
     }
 
     const T* Mem() const				{
+        TIXMLASSERT( _mem );
         return _mem;
     }
 
     T* Mem()							{
+        TIXMLASSERT( _mem );
         return _mem;
     }