Skip to content
Snippets Groups Projects
Commit efd41b35 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

OPEN-358 Readable error

parent 1f542bf5
No related branches found
No related tags found
No related merge requests found
...@@ -116,14 +116,20 @@ void LLAlignedArray<T, alignment>::resize(U32 size) ...@@ -116,14 +116,20 @@ void LLAlignedArray<T, alignment>::resize(U32 size)
template <class T, U32 alignment> template <class T, U32 alignment>
T& LLAlignedArray<T, alignment>::operator[](int idx) T& LLAlignedArray<T, alignment>::operator[](int idx)
{ {
llassert(idx < mElementCount); if(idx >= mElementCount)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}
return mArray[idx]; return mArray[idx];
} }
template <class T, U32 alignment> template <class T, U32 alignment>
const T& LLAlignedArray<T, alignment>::operator[](int idx) const const T& LLAlignedArray<T, alignment>::operator[](int idx) const
{ {
llassert(idx < mElementCount); if (idx >= mElementCount)
{
LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL;
}
return mArray[idx]; return mArray[idx];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment