diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-07-26 23:37:42 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-07-26 23:37:42 +0000 |
commit | d473e27a38126a58b9a793e6cc62768cd02c0c46 (patch) | |
tree | 1167be1e1e4e6a0e2eef0d5789d9c392426d0040 /src/array.h | |
parent | b1558182a40a4a61a811a6879b6278894fe1120f (diff) | |
download | libbu++-d473e27a38126a58b9a793e6cc62768cd02c0c46.tar.gz libbu++-d473e27a38126a58b9a793e6cc62768cd02c0c46.tar.bz2 libbu++-d473e27a38126a58b9a793e6cc62768cd02c0c46.tar.xz libbu++-d473e27a38126a58b9a793e6cc62768cd02c0c46.zip |
Minor helper functions added.
Diffstat (limited to '')
-rw-r--r-- | src/array.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/array.h b/src/array.h index 6571c8a..eeee677 100644 --- a/src/array.h +++ b/src/array.h | |||
@@ -205,6 +205,25 @@ namespace Bu | |||
205 | return core->pData[iIndex]; | 205 | return core->pData[iIndex]; |
206 | } | 206 | } |
207 | 207 | ||
208 | value &get( long iIndex ) | ||
209 | { | ||
210 | _hardCopy(); | ||
211 | if( iIndex < 0 || iIndex >= core->iSize ) | ||
212 | throw ArrayException( | ||
213 | "Index %d out of range 0:%d", iIndex, core->iSize ); | ||
214 | |||
215 | return core->pData[iIndex]; | ||
216 | } | ||
217 | |||
218 | const value &get( long iIndex ) const | ||
219 | { | ||
220 | if( iIndex < 0 || iIndex >= core->iSize ) | ||
221 | throw ArrayException( | ||
222 | "Index %d out of range 0:%d", iIndex, core->iSize ); | ||
223 | |||
224 | return core->pData[iIndex]; | ||
225 | } | ||
226 | |||
208 | value &first() | 227 | value &first() |
209 | { | 228 | { |
210 | _hardCopy(); | 229 | _hardCopy(); |