The relevant portion of the code is located below. I am not sure what else to do. I am searching all engines and reading the text, no luck solving the problem. Could any one help
Well, see, what you gave is the declaration. What we want to know is what is the code behind each and every one of those member functions and operators.
{
throw exception
(
CONTAINER_EMPTY;
"The array is empty. There are no other elements to remove."
);
}
else
{
m_size--;
}
}
template <class generic>
void Array<generic>::clear ()
{
for(int i = m_size; i > 0; i --)
{
pop_back();
}
}
template <class generic>
generic& Array<generic>::operator[] (unsigned int x)
{
if(x < 0 || x > m_size);
{
throw exception
(
OUT_OF_BOUNDS;
"The position is out of the array bounds"
);
}
return m_data[x];
}
template <class generic>
generic& Array<generic>::operator[] (unsigned int x) const
{
if(x >= m_size || x < 0);
{
throw exception
(
OUT_OF_BOUNDS;
"The position is out of the array bounds"
);
}
return m_data[x];
It is hard to follow your code since it is not indented properly, but the first problem I
see is that the correct syntax for an if statement (or if-else) is: