commit 594403903485f440f73d0fb6c7c3ec07031af288 parent fb79388bd90301e4587d5d4c03ebf2e00d95928d Author: Michael Savage <mikejsavage@gmail.com> Date: Fri Nov 11 23:20:24 +0200 ASSERT Diffstat:
array.h | | | 16 | ++++++++-------- |
diff --git a/array.h b/array.h @@ -9,27 +9,27 @@ template< typename T > class array { public: array( T * memory, size_t count ) : n( count ), bytes( sizeof( T ) * count ) { - assert( memory != NULL ); + ASSERT( memory != NULL ); elems = memory; } T & operator[]( size_t i ) { - assert( i < n ); + ASSERT( i < n ); return elems[ i ]; } const T & operator[]( size_t i ) const { - assert( i < n ); + ASSERT( i < n ); return elems[ i ]; } T * operator+( size_t i ) { - assert( i < n ); + ASSERT( i < n ); return &elems[ i ]; } const T * operator+( size_t i ) const { - assert( i < n ); + ASSERT( i < n ); return &elems[ i ]; } @@ -52,17 +52,17 @@ template< typename T > class array2d { public: array2d( T * memory, size_t width, size_t height ) : w( width ), h( height ), bytes( sizeof( T ) * width * height ) { - assert( memory != NULL ); + ASSERT( memory != NULL ); elems = memory; } T & operator()( size_t x, size_t y ) { - assert( in_range( x, y ) ); + ASSERT( in_range( x, y ) ); return elems[ y * w + x ]; } const T & operator()( size_t x, size_t y ) const { - assert( in_range( x, y ) ); + ASSERT( in_range( x, y ) ); return elems[ y * w + x ]; }