diff options
Diffstat (limited to '')
-rw-r--r-- | src/array.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/array.h b/src/array.h index 30d281a..1f11cd9 100644 --- a/src/array.h +++ b/src/array.h | |||
@@ -42,6 +42,7 @@ namespace Bu | |||
42 | iSize( 0 ), | 42 | iSize( 0 ), |
43 | iCapacity( 0 ) | 43 | iCapacity( 0 ) |
44 | { | 44 | { |
45 | *this = src; | ||
45 | } | 46 | } |
46 | 47 | ||
47 | Array( long iSetCap ) : | 48 | Array( long iSetCap ) : |
@@ -57,6 +58,16 @@ namespace Bu | |||
57 | clear(); | 58 | clear(); |
58 | } | 59 | } |
59 | 60 | ||
61 | MyType &operator=( const MyType &src ) | ||
62 | { | ||
63 | clear(); | ||
64 | setCapacity( src.iCapacity ); | ||
65 | long iTop=src.getSize(); | ||
66 | for( long i=0; i<iTop; ++i ) | ||
67 | append( src[i] ); | ||
68 | return *this; | ||
69 | } | ||
70 | |||
60 | /** | 71 | /** |
61 | * Clear the array. | 72 | * Clear the array. |
62 | */ | 73 | */ |