You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ 4%] Building CXX object sakura_core/CMakeFiles/sakura.dir/CGrepAgent.cpp.obj
C:\gitroot\sakura-mygithub\sakura_core\CGrepAgent.cpp: In member function 'void CGrepAgent::AddTail(CEditView*, const CNativeW&, bool)':
C:\gitroot\sakura-mygithub\sakura_core\CGrepAgent.cpp:139:9: warning: 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
std::auto_ptr<CCodeBase> pcCodeBase( CCodeFactory::CreateCodeBase(
^~~~~~~~
In file included from D:/eclipse4.6/eclipse/mingw/lib/gcc/x86_64-w64-mingw32/6.2
.0/include/c++/memory:81:0,
from C:\gitroot\sakura-mygithub\sakura_core\StdAfx.h:68,
from C:\gitroot\sakura-mygithub\sakura_core\CGrepAgent.cpp:1:
D:/eclipse4.6/eclipse/mingw/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/bits/unique_ptr.h:49:28: note: declared here
template<typename> class auto_ptr;
^~~~~~~~
警告の肝は 'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations] です。
「gccのオプション -Wdeprecated-declarations を付ければこの警告を無効にできる」と言ってます。 std::auto_ptr の定義ファイル名から、代替が std::unique_ptr であることも分かります。
スマートポインタ
std::auto_ptr
はC++11で非推奨となったテンプレートです。サクラエディタはC++が規格化される前から存在するものなので、
標準的なC++の作法とズレてるところがちょこちょこあります。
スマートポインタ
std::auto_ptr
もその1つです。auto_ptrはダメなのか? - munepi.com
※記事内で言及されている
boost::shared_ptr
はC++規格に取り込まれてstd::shared_ptr
になっています。現状のサクラエディタを MinGW でビルドすると、以下のような警告がたくさん出ます。
警告の肝は
'template<class> class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
です。「gccのオプション
-Wdeprecated-declarations
を付ければこの警告を無効にできる」と言ってます。std::auto_ptr
の定義ファイル名から、代替がstd::unique_ptr
であることも分かります。警告を無効にするのは、対処が必要な警告に気付けない原因となるので避けたいです。
対策として
s/std::auto_ptr/std::unique_ptr/g
の一括置換を行いたいと思っています。何かご意見あればここにコメントをお願いします。
The text was updated successfully, but these errors were encountered: