コピーエリジョンはキャッチステートメントで発生する可能性がありますか?
-
29-10-2019 - |
質問
副作用を備えたコピーコンストラクターを備えた例外クラスを検討してください。
ここでコピーコンストラクターを呼び出すコンパイラをスキップできますか:
try {
throw ugly_exception();
}
catch(ugly_exception) // ignoring the exception, so I'm not naming it
{ }
これはどうですか:
try {
something_that_throws_ugly_exception();
}
catch(ugly_exception) // ignoring the exception, so I'm not naming it
{ }
(はい、私はこれがすべて非常に醜いことを知っています、これはに触発されました 別の質問)
正しい解決策はありません
所属していません StackOverflow