[lug] g++ signals and exceptions question

Tkil tkil at scrye.com
Wed May 15 12:31:32 MDT 2002


>>>>> "jb" == Jonathan Briggs <zlynx at acm.org> writes:

jb> I was thinking that it would be pretty neat if a C++ program could
jb> catch a signal and raise an exception.  [...]  Do any of you who
jb> are experienced C++ programmers see anything wrong with this idea?

There's a fundamental difference between the two types of events:
signals are asynchronous, while exceptions are synchronous.

I believe that even Stroustrup mentions this distinction in _The C++
Programming Language_.

Looking at it another way, where would you catch the exception
"caused" by a signal?

Maybe if you can give an example of how you'd like to use such a
construct?

t.




More information about the LUG mailing list