You're right. Thank!
Strangely it doesn't throw in operator[]. :confused:
Edit :
May be the C++ operator[] doesn't allow throwing? Any reason for that?
Printable View
You're right. Thank!
Strangely it doesn't throw in operator[]. :confused:
Edit :
May be the C++ operator[] doesn't allow throwing? Any reason for that?
Well there are conditions under which you don't want to
throw an exception.
Error checking reduces performance and the STL was designed
for performance (This is one reason why the destructors of the
containers are not virtual).
What I have read on the matter is it was decided not to include
error checking in all operations because then you could not
write applications without error checking. Of course you
can always add error checking by writing your own wrapper.
souldog, thank very much for your informative description. :)