From 50edcf2d3e4a8f036e673cf91545551641fbd640 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 2 Nov 2016 12:56:07 +0100 Subject: [PATCH] fix conversions of unique_ptrs --- alib2algo/src/regexp/transform/RegExpDerivation.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alib2algo/src/regexp/transform/RegExpDerivation.cpp b/alib2algo/src/regexp/transform/RegExpDerivation.cpp index 6028c36df7..272eae1bc7 100644 --- a/alib2algo/src/regexp/transform/RegExpDerivation.cpp +++ b/alib2algo/src/regexp/transform/RegExpDerivation.cpp @@ -91,7 +91,7 @@ std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > RegExpDe for(const auto& child : alternation.getElements()) ret->appendElement( * ( child->accept<std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > >, regexp::RegExpDerivation::Unbounded > ( argument ) ) ); - return ret; + return std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > ( std::move ( ret ) ); } std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > RegExpDerivation::Unbounded::visit(const regexp::UnboundedRegExpConcatenation < alphabet::Symbol > & concatenation, const alphabet::Symbol& argument) { @@ -111,14 +111,14 @@ std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > RegExpDe break; } - return ret; + return std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > ( std::move ( ret ) ); } std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > RegExpDerivation::Unbounded::visit(const regexp::UnboundedRegExpIteration < alphabet::Symbol > & iteration, const alphabet::Symbol& argument) { - UnboundedRegExpConcatenation < alphabet::Symbol > * con = new regexp::UnboundedRegExpConcatenation < alphabet::Symbol > ( ); + std::unique_ptr < UnboundedRegExpConcatenation < alphabet::Symbol > > con ( new regexp::UnboundedRegExpConcatenation < alphabet::Symbol > ( ) ); con->appendElement ( * ( iteration.getElement().accept<std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > >, regexp::RegExpDerivation::Unbounded > ( argument ) ) ); con->appendElement ( iteration ); - return std::unique_ptr < UnboundedRegExpElement < alphabet::Symbol > > ( con ); + return std::unique_ptr < UnboundedRegExpElement < alphabet::Symbol > > ( std::move ( con ) ); } std::unique_ptr < regexp::UnboundedRegExpElement < alphabet::Symbol > > RegExpDerivation::Unbounded::visit(const regexp::UnboundedRegExpSymbol < alphabet::Symbol > & symbol, const alphabet::Symbol& argument) { -- GitLab