2012/7/8 Stefan Behnel <stefan...@behnel.de>:
> ... and there also were some more headers missing, so basically, this
> feature never worked. Great. Here's the complete implementation with the
> four header files that I had to add at the top:

I'm pretty sure that at some point, it worked. I implemented this in
6291a2 and the five prior commits, but I did add the appropriate
headers to Cython/Compiler/Nodes.py.

There is a unit test for this feature in tests/run/cpp_exceptions.pyx;
that file includes a header that in turn includes <ios>, <new> and
<stdexcept>, but not <typeinfo> because it doesn't need that to raise
the exception. (It would be more reliable if the test where refactored
into C++ modules so that the headers need not be indirectly included.)

> #include <iostream>

Actually, you'll want to include <ios> where std::ios_base is
declared. <iostream> is a much "heavier" header.

> Does it make sense to always include these four headers, or should we try
> to handle the exceptions conditionally?

As I said, this should already have been done by
Cython/Compiler/Nodes.py. I'm not sure what's going wrong.

-- 
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to