medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 704b706cf41dc1d38b577da136350a0d4a2098a1
parent c5330c66328e67ffb4564ad2f99048eb3a6d828d
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Dec 25 13:48:54 +0200

Remove ArrayIterator completely

Diffstat:
array.h | 38++++++++------------------------------
1 file changed, 8 insertions(+), 30 deletions(-)
diff --git a/array.h b/array.h @@ -6,28 +6,6 @@ #include "intrinsics.h" template< typename T > -class ArrayIterator { -public: - ArrayIterator( T * ptr ) { - cursor = ptr; - } - - T & operator*() { - return *cursor; - } - - bool operator!=( ArrayIterator< T > other ) { - return cursor != other.cursor; - } - - void operator++() { - cursor++; - } -private: - T * cursor; -}; - -template< typename T > class array { public: array() { @@ -76,20 +54,20 @@ public: return sizeof( T ) * n; } - ArrayIterator< T > begin() { - return ArrayIterator< T >( elems ); + T * begin() { + return elems; } - ArrayIterator< T > end() { - return ArrayIterator< T >( elems + n ); + T * end() { + return elems + n; } - ArrayIterator< const T > begin() const { - return ArrayIterator< const T >( elems ); + const T * begin() const { + return elems; } - ArrayIterator< const T > end() const { - return ArrayIterator< const T >( elems + n ); + const T * end() const { + return elems + n; } size_t n;