[C++-sig] Re: Converting std::out_of_range to Python IndexError

David Abrahams dave at boost-consulting.com
Thu Sep 11 18:45:47 CEST 2003


Raoul Gough <RaoulGough at yahoo.co.uk> writes:

> In working on the indexing suite, I came across a std::out_of_range
> exception (thrown by std::vector<>::at) and wanted it to arrive in
> Python as an IndexError - this functions similarly to the
> StopIteration exception for sequences with __getitem__ rather than
> __iter__. Anyway, adding it to libs/python/src/errors.cpp is trivial
> (diff follows this paragraph). I also added an explicit include for
> <stdexcept>, since this header is the one that defines the standard
> exception hierarchy. OK to commit these changes?

Whoops; I shoulda just said yes.  Forgot you had commit permission
and did it myself.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list