I got a compiler error and noticed something interesting. For some reason, unique_ptr has overloaded for auto_ptr , but I thought auto_ptr deprecated:
/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*'
Is it due to backward compatibility with the code that used auto_ptr ?
source share