From d473e27a38126a58b9a793e6cc62768cd02c0c46 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 26 Jul 2010 23:37:42 +0000 Subject: Minor helper functions added. --- src/array.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/array.h') 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 return core->pData[iIndex]; } + value &get( long iIndex ) + { + _hardCopy(); + if( iIndex < 0 || iIndex >= core->iSize ) + throw ArrayException( + "Index %d out of range 0:%d", iIndex, core->iSize ); + + return core->pData[iIndex]; + } + + const value &get( long iIndex ) const + { + if( iIndex < 0 || iIndex >= core->iSize ) + throw ArrayException( + "Index %d out of range 0:%d", iIndex, core->iSize ); + + return core->pData[iIndex]; + } + value &first() { _hardCopy(); -- cgit v1.2.3