THRIFT-3622 Fix deprecated uses of std::auto_ptr
Client: cpp
Patch: zeshuai007 <51382517@qq.com>
This closes #2135
diff --git a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
index a3ac854..14d1eb5 100644
--- a/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_cpp_generator.cc
@@ -2199,7 +2199,7 @@
<< "public " << svcname << "CobSvIf {" << endl << " public:" << endl;
indent_up();
f_skeleton << indent() << svcname << "AsyncHandler() {" << endl << indent()
- << " syncHandler_ = std::auto_ptr<" << svcname << "Handler>(new " << svcname
+ << " syncHandler_ = std::unique_ptr<" << svcname << "Handler>(new " << svcname
<< "Handler);" << endl << indent() << " // Your initialization goes here" << endl
<< indent() << "}" << endl;
f_skeleton << indent() << "virtual ~" << service_name_ << "AsyncHandler();" << endl;
@@ -2223,7 +2223,7 @@
scope_down(f_skeleton);
}
- f_skeleton << endl << " protected:" << endl << indent() << "std::auto_ptr<" << svcname
+ f_skeleton << endl << " protected:" << endl << indent() << "std::unique_ptr<" << svcname
<< "Handler> syncHandler_;" << endl;
indent_down();
f_skeleton << "};" << endl << endl;