我在一个项目中有以下代码,它给了我一个错误 C2059,语法错误“新”,该unique_ptr
行是错误的。
#include <memory>
class Nothing {
public:
Nothing() { };
};
class IWriter
{
public:
IWriter() {
}
~IWriter() {
}
private:
std::unique_ptr<Nothing> test(new Nothing());
};
这里发生了什么?