home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!comp.vuw.ac.nz!kauri.vuw.ac.nz!robertd
- From: robertd@kauri.vuw.ac.nz (Robert Davies)
- Subject: Re: setjmp/longjmp question
- Nntp-Posting-Host: kauri.vuw.ac.nz
- Message-ID: <C1LL3z.8oI@comp.vuw.ac.nz>
- Organization: Victoria University of Wellington
- Sender: news@comp.vuw.ac.nz (News Admin)
- References: <KANZE.93Jan25184636@slsvdnt.us-es.sel.de> <1993Jan26.182029.23023@taumet.com> <KANZE.93Jan28194037@slsvdnt.us-es.sel.de>
- Date: Fri, 29 Jan 1993 04:14:22 GMT
- Lines: 23
-
- kanze@us-es.sel.de (James Kanze) writes:
- ....
-
- >As a more general rule, you can emmulate exceptions with
- >setjmp/longjmp, if you accept that all of your class objects derive
- >from a common base class, which determines (in some machine dependent
- >fashion) whether the object is on the stack or not, and if it is,
- >registers it. This is definitely non-trivial, though, and in the
- >presence of multiple inheritance, you'd better be sure that your
- >compiler does virtual base classes right, too. (GNU definitely has
- >problems, and I have heard that Borland does too.) Also, it has a
- >non-negligible run-time overhead.
- ....
- My matrix package newmat07 (which is available on the ftp sites that
- archive comp.sources.misc) does this. I expect it is a little compiler
- dependent, but it does seem to work. And it certainly simplifies the
- handling of exceptions.
-
- Come on real exception handling!
-
- Robert
-
-
-