Почему не ловится исключение (скомпилировано с /RTCc и /EHa)? Деление на 0 ловится. Это где-то сказано, что ошибки приведения типов не отлавливаются?
#include <iostream>
#include <stdexcept>
#include <eh.h>
class seh_exception : public std::exception
{
unsigned int code_;
public:
seh_exception( unsigned int code ) : code_( code ) {}
unsigned int code() const { return code_; }
};
void seh_translator( unsigned int code, _EXCEPTION_POINTERS* )
{
throw seh_exception( code );
}
int main()
{
_set_se_translator( &seh_translator );
try {
int i = SHRT_MAX * 4;
short j = i;
std::cout << j;
}
catch ( const seh_exception& e ) {
std::cout << e.code() << std::endl;
}
}