От: | Аноним | ||
Дата: | 28.11.05 10:40 | ||
Оценка: |
class Exception : public std::exception
{
};
class CSomeOne
{
public:
void someFun (void)
{
// ...............
throw Exception;
//................
};
};
int main (void)
{
try
{
CSomeOne().someFun();
}
catch (Exception)
{
std::cout << "Exception" << std::endl;
}
catch (std::exception)
{
std::cout << "std::exception" << std::endl;
}
catch (...)
{
std::cout << "..." << std::endl;
}
return 0;
}
$ g++ -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)