我有这个代码:
// util.h
#include <memory>
template <class T>
class ArrayDeleter {
public:
void operator () (T* d) const
{ delete [] d; }
};
std::shared_ptr<char, ArrayDeleter<char> > V8StringToChar(v8::Handle<v8::String> str);
std::shared_ptr<char, ArrayDeleter<char> > V8StringToChar(v8::Local<v8::Value> val);
它给了我错误:
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\memory
(1418) : see declaration of 'std::tr1::shared_ptr'c:\cef\appjs_final\appjs\src\includes\util.h(27):
error C2977: 'std::tr1::shared_ptr' : too many template arguments
[C:\CEF\appjs_final\appjs\build\appjs.vcxproj]