medfall

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

commit 390bdd48b7e75a399e82df38e008803eb1784fb6
parent f0b31ef8b90cca6baca87cae0d12d839aea82d02
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Dec 25 13:22:08 +0200

Use ArrayIterator< const T > instead of ConstArrayIterator

Diffstat:
array.h | 30++++--------------------------
1 file changed, 4 insertions(+), 26 deletions(-)
diff --git a/array.h b/array.h @@ -28,28 +28,6 @@ private: }; template< typename T > -class ConstArrayIterator { -public: - ConstArrayIterator( T * ptr ) { - cursor = ptr; - } - - const T & operator*() { - return *cursor; - } - - bool operator!=( ConstArrayIterator< T > other ) { - return cursor != other.cursor; - } - - void operator++() { - cursor++; - } -private: - T * cursor; -}; - -template< typename T > class array { public: array() { @@ -106,12 +84,12 @@ public: return ArrayIterator< T >( elems + n ); } - ConstArrayIterator< T > begin() const { - return ConstArrayIterator< T >( elems ); + ArrayIterator< const T > begin() const { + return ArrayIterator< const T >( elems ); } - ConstArrayIterator< T > end() const { - return ConstArrayIterator< T >( elems + n ); + ArrayIterator< const T > end() const { + return ArrayIterator< const T >( elems + n ); } size_t n;