2012-05-06 19 views
0

Visual StudioをIDEとして使用してC++でコーディングしています。Visual Studio 2008のスマートポインタ

私はC++知性のポインタを使用しようとしているが、私はエラーを取得:

#include <memory> 

を、それは問題を解決しませんでした:

error C2039: 'shared_ptr' : is not a member of 'std' 
error C2039: 'unique_ptr' : is not a member of 'std' 

私は含まれています。

Visual Studio 2008でこの機能を使用できますか? Visual Studio 2010に移行する必要がありますか?

答えて

2

std::shared_ptrおよびおよびは、C++ 11の機能であり、VS2008ではサポートされていません。

代わりにboost smart pointersを使用できます。

0

あなたはあなたが使用することができますstd::tr1::shared_ptrstd::tr1::unique_ptr

1

を使用しようとすることができますはstd :: tr1を:: shared_ptrのVS2008でと名前空間std :: tr1をを使用してメモリ 2.ヘッダーが含ま項目 1.下には必須。