Changeset 3662
- Timestamp:
- 06/22/08 21:46:44 (3 months ago)
- Files:
-
- trunk/tango/util/container/more/Vector.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tango/util/container/more/Vector.d
r3657 r3662 31 31 32 32 alias slice opSlice; 33 alias nth opIndex;34 33 35 34 /*********************************************************************** … … 141 140 /********************************************************************** 142 141 143 Index vector entries, where a zero index represents the 144 oldest vector entry (the top). 142 Index vector entries, as though it were an array 145 143 146 144 Throws an exception when the given index is out of range … … 148 146 **********************************************************************/ 149 147 150 V nth(uint i)148 V opIndex (uint i) 151 149 { 152 150 if (i < depth) 153 151 return vector [i]; 152 153 return error (__LINE__); 154 } 155 156 /********************************************************************** 157 158 Assign vector entries as though it were an array. 159 160 Throws an exception when the given index is out of range 161 162 **********************************************************************/ 163 164 V opIndexAssign (V value, uint i) 165 { 166 if (i < depth) 167 { 168 vector[i] = value; 169 return value; 170 } 154 171 155 172 return error (__LINE__);












