T
Tony Johansson
Hello!
In this overloaded index operator I have just add this throw() in the header
just to check what happen when an exception is thrown.
This throw() in the header should means that this method should not throw
anything.
But the strange thing is that I don't get any error when this user defined
exception MyOutOfRange is throw.
Can anybody explain that to me?
int& operator[](int i) throw() ; //Here is the declaration
int& Intvektor:perator[](int i) throw()
{
if (i >= size || i < 0)
throw MyOutOfRange("Intvektor:: Positionering som ligger utanför
giltigt område\n");
return array;
}
//Tony
In this overloaded index operator I have just add this throw() in the header
just to check what happen when an exception is thrown.
This throw() in the header should means that this method should not throw
anything.
But the strange thing is that I don't get any error when this user defined
exception MyOutOfRange is throw.
Can anybody explain that to me?
int& operator[](int i) throw() ; //Here is the declaration
int& Intvektor:perator[](int i) throw()
{
if (i >= size || i < 0)
throw MyOutOfRange("Intvektor:: Positionering som ligger utanför
giltigt område\n");
return array;
}
//Tony