c++ - Exceptions Specifications and std input iterators -
i have input iterator makes use of 2 methods getfirst , getnext. both of these function part of api , theoretically these functions can fail in operation whatever reason. in case i'm casting runtime exception.
i've never used exception specifications in c++ thinking might time start. constructor , operator++ functions specify can throw runtime error.
then did quick search in vector.h file (std::vector) dont see throw used there. how come?
if have reached end of iterator , *(i++) should there exception?
if have reached end of iterator , *(i++) should there exception?
yes thats error.
about exception specification better specify when method not throw. , not opposite. take @ this question.
Comments
Post a Comment