go back to original version since it did not compile under Linux and MacOS
This commit is contained in:
parent
7320b0a4cc
commit
90467df03c
1 changed files with 6 additions and 5 deletions
11
src/util.h
11
src/util.h
|
@ -128,45 +128,46 @@ public:
|
||||||
// this function simply converts the type of size to integer
|
// this function simply converts the type of size to integer
|
||||||
inline int Size() const { return std::vector<TData>::size(); }
|
inline int Size() const { return std::vector<TData>::size(); }
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
|
||||||
// This operator allows for a l-value assignment of this object:
|
// This operator allows for a l-value assignment of this object:
|
||||||
// CVector[x] = y is possible
|
// CVector[x] = y is possible
|
||||||
inline TData& operator[] ( const int iPos )
|
inline TData& operator[] ( const int iPos )
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG_
|
||||||
if ( ( iPos < 0 ) || ( iPos > Size() - 1 ) )
|
if ( ( iPos < 0 ) || ( iPos > Size() - 1 ) )
|
||||||
{
|
{
|
||||||
DebugError ( "Writing vector out of bounds", "Vector size",
|
DebugError ( "Writing vector out of bounds", "Vector size",
|
||||||
Size(), "New parameter", iPos );
|
Size(), "New parameter", iPos );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return std::vector<TData>::operator[] ( iPos );
|
return std::vector<TData>::operator[] ( iPos );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline TData operator[] ( const int iPos ) const
|
inline TData operator[] ( const int iPos ) const
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG_
|
||||||
if ( ( iPos < 0 ) || ( iPos > Size() - 1 ) )
|
if ( ( iPos < 0 ) || ( iPos > Size() - 1 ) )
|
||||||
{
|
{
|
||||||
DebugError ( "Reading vector out of bounds", "Vector size",
|
DebugError ( "Reading vector out of bounds", "Vector size",
|
||||||
Size(), "New parameter", iPos );
|
Size(), "New parameter", iPos );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return std::vector<TData>::operator[] ( iPos );
|
return std::vector<TData>::operator[] ( iPos );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline CVector<TData>& operator= ( const CVector<TData>& vecI )
|
inline CVector<TData>& operator= ( const CVector<TData>& vecI )
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG_
|
||||||
// vectors which shall be copied MUST have same size!
|
// vectors which shall be copied MUST have same size!
|
||||||
if ( vecI.Size() != Size() )
|
if ( vecI.Size() != Size() )
|
||||||
{
|
{
|
||||||
DebugError ( "Vector operator=() different size", "Vector size",
|
DebugError ( "Vector operator=() different size", "Vector size",
|
||||||
Size(), "New parameter", vecI.Size() );
|
Size(), "New parameter", vecI.Size() );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
std::vector<TData>::operator= ( vecI );
|
std::vector<TData>::operator= ( vecI );
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue