Explicit calls to unexpected()?

K

Ken

Any thoughts on making explicit calls to unexpected()? My sense is
that this function is really intended to be invoked automatically as
part of exception handling. Are there times when explicit calls would
be useful? Or would doing so introduce bug risks or maintanance
headaches unnecessarily?

Thanks for any opinions!

Ken
 
T

Truls Haaland

Any thoughts on making explicit calls to unexpected()? My sense is
that this function is really intended to be invoked automatically as
part of exception handling. Are there times when explicit calls would
be useful? Or would doing so introduce bug risks or maintanance
headaches unnecessarily?

Thanks for any opinions!

Ken

I think the name says it all really. If you call unexpected()
explicitly, then it's not really unexpected is it? ;-)

The only possible reason for doing so I can think of would have to be
in a assert() type of function, since unexpected() normally calls
abort() which will abort the program(duh!).

And I guess it would introduce maintainance problems since the first
thing I would think of when seeing an explicit call to unexpected
would be utter confusion.

T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top