C++相談室 part122 [無断転載禁止]©5ch.io
■ このスレッドは過去ログ倉庫に格納されています
0163デフォルトの名無しさん
2016/01/27(水) 21:46:53.21ID:gqKHFo+S> B() try : _id(GetId()), _a(_id)
> {
> cout << "B:B" << _id << endl;
> }
> catch(int ex)
> {
> cout << "B:B" << _id << " exception " << ex << endl;
このcatch内でのメンバ変数 _id の参照は未定義動作になる。
15.3 [except.handle] p10
> Referring to any non-static member or base class of an object in the
> handler for a function-try-block of a constructor or destructor for that
> object results in undefined behavior.
■ このスレッドは過去ログ倉庫に格納されています