Commit 3f13248a authored by Pavel Vainerman's avatar Pavel Vainerman

fix: moving a local object in a return statement prevents copy elision [-Werror=pessimizing-move]

parent dd96d321
......@@ -93,7 +93,7 @@ namespace uniset
auto o = uniset::make_object<T>(idname, secname, std::forward<_Args>(__args)...);
m->add(o);
m->logAgregator()->add(o->logAgregator());
return std::move(o);
return o;
}
catch( const uniset::Exception& ex )
{
......@@ -111,7 +111,7 @@ namespace uniset
auto o = uniset::make_object_x<T>(root, secname, std::forward<_Args>(__args)...);
m->add(o);
m->logAgregator()->add(o->logAgregator());
return std::move(o);
return o;
}
catch( const uniset::Exception& ex )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment