prog.cpp:5:10: error: 'shared_ptr' in namespace 'std' does not name a template type
std::shared_ptr<T>& _sp;
^
prog.cpp:7:24: error: expected ')' before '<' token
out(std::shared_ptr<T>& sp) : _p(nullptr) , _sp(sp) {}
^
prog.cpp: In destructor 'out<T>::~out()':
prog.cpp:8:14: error: '_sp' was not declared in this scope
~out() { _sp.reset(_p); }
^
prog.cpp: At global scope:
prog.cpp:13:22: error: template declaration of 'out<T> make_out'
out<T> make_out(std::shared_ptr<T> ptr)
^
prog.cpp:13:17: error: 'shared_ptr' is not a member of 'std'
out<T> make_out(std::shared_ptr<T> ptr)
^
prog.cpp:13:34: error: expected primary-expression before '>' token
out<T> make_out(std::shared_ptr<T> ptr)
^
prog.cpp:13:36: error: 'ptr' was not declared in this scope
out<T> make_out(std::shared_ptr<T> ptr)
^