Ah, C++ standard library: of course you had to define two different exception types, "std::out_of_range" and "std::range_error".