Hi,
I've just came across declaration of this form:

void fun() throw();

Could anyone explain what is the pourpose of this and maybe someone knows good book with thorough explanaition on this subject.
Thank you

Recommended Answers

All 5 Replies

Having a hard time using Google?
My first advice before starting a new thread is: STFW first!

Well, first I would like to thank you for your help, secondly - I really don't like wasting my time searching through tens of pages from google results and reading sometimes pointless dabates and discussion of people who very often don't know what they are really talking about. I'd prefer to ask experts and if possible get if not answer at least a hint or direction where shall I start my search or what shall I try to read. Thats why I asked this question on this forum and used google.
As for STFW - absolutely no clue what it means;)

"void fun() throw();"

That declaration tells compiler that this function , fun(), won't throw
any exception.

Similarly :
void fun() throw(myException& m);

Tells compiler and user that this function could throw a exception
shown.

RTFM and STFW are no mistery for me anymore!!!
Thankx tux4life!;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.