How to catch the exception in initialization list?

Posted by skydoor on Stack Overflow See other posts from Stack Overflow or by skydoor
Published on 2010-03-14T02:44:59Z Indexed on 2010/03/14 2:55 UTC
Read the original article Hit count: 351

Filed under:
|

Hi

I have a question about how to catch the exception in the initialization list.

For example, we have a class Foo derived from Bar

class Foo {

public:
Foo(int i) {throw 0; }

}

class Bar : public Foo{

public:

Bar() : Foo(1) {}

}

© Stack Overflow or respective owner

Related posts about c++

Related posts about initialization-list