What does: throw 0 do/mean? Is it "bad"?

Posted by MartinP on Stack Overflow See other posts from Stack Overflow or by MartinP
Published on 2010-04-13T10:14:00Z Indexed on 2010/04/13 10:23 UTC
Read the original article Hit count: 331

Filed under:
|

Context

I came across some code, like this:

if( Some_Condition ) throw 0;

I googled a bit, and found a few other code snippets using that odd looking throw 0 form.

I presume one would catch this as:

catch(const int& e) 
{  }

Or is this a NULL ptr? to be caught as void* ?

Question

What does this throw 0 do? Is it special in some way?

My normal preference would be to throw something that is (or derived from) std::exception. So to me this looks "bad". Is it "bad" ?

© Stack Overflow or respective owner

Related posts about c++

Related posts about exception