C++相談室 part87
■ このスレッドは過去ログ倉庫に格納されています
0561デフォルトの名無しさん
2010/12/27(月) 00:26:04それでも結局 new Fuga の後 auto_ptr の構築前に operator new の呼び出しが
行われる可能性があるからダメ。
new の結果は常に名前つきのスマートポインタで保持するのが最善手。
http://www.boost.org/libs/smart_ptr/shared_ptr.htm#BestPractices
> A simple guideline that nearly eliminates the possibility of memory leaks is:
> always use a named smart pointer variable to hold the result of new.
■ このスレッドは過去ログ倉庫に格納されています