Mail Archives: djgpp/2001/07/30/02:19:40
"Rafal Maj (Raf256)" wrote:
>
> DJGPP allows statment throw ; is it ok ? If yes, then how can I catch
> such exception ?
>
> try { throw ; } catch(...) { cerr<<"OK :)"<<endl; }
>
> This doesn't work, throw is not catched, and it generates default_terminate
> and abort.
I wouldn't expect it to work. A bare 'throw' rethrows the current
exception,
so it is mainly for use in a catch block. If there is no current
exception,
i calls either unexpected() or terminate() (not sure which; check the
call
stack), which eventually calls terminate(), which for gcc calls abort().
Simply throwing _something_ should make things work.
try { throw "Rafal"; } catch (...) { cerr << "OK :)" << endl; }
--
Tim Van Holder - Anubex N.V.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This message was posted using plain text. I do not endorse any
products or services that may be hyperlinked to this message.
- Raw text -