Skip to content
Snippets Groups Projects
Commit fe2d53e8 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

replace deprecated std::auto_ptr with std::unique_ptr

parent a39323a4
Branches
Tags
No related merge requests found
......@@ -33,7 +33,7 @@ using namespace ost::gfx;
namespace {
Gradient* make_gradient_d(const dict& d)
{
std::auto_ptr<Gradient> grad(new Gradient);
std::unique_ptr<Gradient> grad(new Gradient);
list keys = d.keys();
for(int i=0;i<len(keys);++i) {
extract<float> fex(keys[i]);
......@@ -65,7 +65,7 @@ namespace {
Gradient* make_gradient_l(const list& l)
{
std::auto_ptr<Gradient> grad(new Gradient);
std::unique_ptr<Gradient> grad(new Gradient);
float mf = len(l)<2 ? 0.0 : 1.0/static_cast<float>(len(l)-1);
for(int i=0;i<len(l);++i) {
float mark = static_cast<float>(i)*mf;
......
......@@ -45,8 +45,7 @@ object app_get_menu(Perspective* pers, const QString& name)
void export_Perspective()
{
class_<Perspective, std::auto_ptr<Perspective>,
boost::noncopyable>("Perspective", no_init)
class_<Perspective, boost::noncopyable>("Perspective", no_init)
.def("GetPanels", &Perspective::GetPanels,
return_value_policy<reference_existing_object>())
.def("GetMainArea", &Perspective::GetMainArea,
......
......@@ -743,7 +743,7 @@ Node* QueryImpl::ParsePropValueExpr(QueryLexer& lexer) {
return NULL;
}
}
std::auto_ptr<Node> root_value(NULL);
std::unique_ptr<Node> root_value;
do {
Node* sel_node=this->ParseValueOrRange(property, op, lexer);
if (sel_node==NULL) {
......@@ -814,10 +814,10 @@ Node* QueryImpl::ParseBracketSubExpr(QueryLexer& lexer) {
}
Node* QueryImpl::ParseSubExpr(QueryLexer& lexer, bool paren) {
// Use auto_ptr to protect against memory leaks. In case of early exit, i.e.
// Use unique_ptr to protect against memory leaks. In case of early exit, i.e.
// exceptions, the memory associated with root_node and its child nodes will
// be freed.
std::auto_ptr<Node> root_node(NULL);
std::unique_ptr<Node> root_node;
Node* new_node=NULL;
QueryToken t=lexer.CurrentToken();
LogicOP logic_op=LOP_AND;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment