Mic*_*ele 1 c++ vector shared-ptr unique-ptr
我正在尝试从我的vector中弹出我的shared_pointer并转换为unique_ptr.不幸的是,它给出了一个奇怪的编译信息.
IFCCB.cpp:
std::unique_ptr<IFC> IFCCCB::getElementVectorIFC()
{
return (std::unique_ptr<IFC>(make_unique<IFC>(m_shpVectorIFC.pop_back())));
}
Run Code Online (Sandbox Code Playgroud)
IFCCB.h:
public:
unique_ptr<IFC> getElementVectorIFC();
Run Code Online (Sandbox Code Playgroud)
编译错误:
错误C2784:'enable_if :: value,std :: unique_ptr <_Ty,std :: default_delete <_Ty >>> :: type std :: make_unique(_Types && ...)':无法推断'_Types &&的模板参数'from'void'
据我所知,我正在做我在别处看到的事情.
我查看了make_unique信息,但它没有给出一个非常好的示例,并且使用了unique_ptr.有任何想法吗?
归档时间: |
|
查看次数: |
1490 次 |
最近记录: |