home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 20103 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.4 KB  |  36 lines

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