S
subramanian100in
For vector and deque, the 'at( )' member function throws out_of_range
exception if the argument to the 'at( )' function is not in range. But
the subscript operator [ ] does not throw this exception for the same
situation.
My question:
Why can't the subscript operator [ ] itself throw the out_of_range
exception in which case the 'at ( )' member function may not be
needed ?
Kindly explain
Thanks
V.Subramanian
exception if the argument to the 'at( )' function is not in range. But
the subscript operator [ ] does not throw this exception for the same
situation.
My question:
Why can't the subscript operator [ ] itself throw the out_of_range
exception in which case the 'at ( )' member function may not be
needed ?
Kindly explain
Thanks
V.Subramanian