In the user manual, 3.4 Exceptions says the following:
"The largest set of non-optional exceptions are those from the
Standard C++ Library. For instance, if your code said "row" on a
row containing only 5 fields, the std::vector underlying the row
object will throw an exception. (It will, that is, if it conforms to
the standard.) You might consider wrapping your program's main loop in
a try block catching std::exceptions, just in case you trigger one of
This has me confused. vector::operator does not throw exceptions
for out-of-range indexes, so I was surprised that Row does.
I looked at the source for Row
and it seems that operator is actually calling the vector's at.
That seems like a waste of time, since it's already checked that the
index is valid. And in the case that the index *is* out of range, it
throws a custom exception, not the one from vector::at, contrary to