use*_*715 5 c++ auto-ptr unique-ptr c++11
我收到编译错误,发现有趣的东西.由于某种原因unique_ptr有一个超载auto_ptr,但我认为auto_ptr已被弃用:
/usr/local/include/c++/4.9.0/bits/unique_ptr.h:228:2:
note:template<class _Up, class>
std::unique_ptr<_Tp, _Dp>::unique_ptr(std::auto_ptr<_Up>&&)
unique_ptr(auto_ptr<_Up>&& __u) noexcept;
/usr/local/include/c++/4.9.0/bits/unique_ptr.h:228:2:
note: template argument deduction/substitution failed:
main.cpp:41:67: note: mismatched types 'std::auto_ptr<T>' and 'char*'
Run Code Online (Sandbox Code Playgroud)
这是因为与使用的代码向后兼容auto_ptr吗?
| 归档时间: |
|
| 查看次数: |
293 次 |
| 最近记录: |