From 90467df03c12ed310512a73ce1ed4cec72fc751d Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 19 Jan 2014 15:03:11 +0000 Subject: [PATCH] go back to original version since it did not compile under Linux and MacOS --- src/util.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/util.h b/src/util.h index 7cc7669f..b5c1fce5 100755 --- a/src/util.h +++ b/src/util.h @@ -128,45 +128,46 @@ public: // this function simply converts the type of size to integer inline int Size() const { return std::vector::size(); } -#ifdef _DEBUG_ // This operator allows for a l-value assignment of this object: // CVector[x] = y is possible inline TData& operator[] ( const int iPos ) { +#ifdef _DEBUG_ if ( ( iPos < 0 ) || ( iPos > Size() - 1 ) ) { DebugError ( "Writing vector out of bounds", "Vector size", Size(), "New parameter", iPos ); } - +#endif return std::vector::operator[] ( iPos ); } inline TData operator[] ( const int iPos ) const { +#ifdef _DEBUG_ if ( ( iPos < 0 ) || ( iPos > Size() - 1 ) ) { DebugError ( "Reading vector out of bounds", "Vector size", Size(), "New parameter", iPos ); } - +#endif return std::vector::operator[] ( iPos ); } inline CVector& operator= ( const CVector& vecI ) { +#ifdef _DEBUG_ // vectors which shall be copied MUST have same size! if ( vecI.Size() != Size() ) { DebugError ( "Vector operator=() different size", "Vector size", Size(), "New parameter", vecI.Size() ); } - +#endif std::vector::operator= ( vecI ); return *this; } -#endif };