Skip to content
Snippets Groups Projects
Commit 2fe174b7 authored by Tomáš Pecka's avatar Tomáš Pecka
Browse files

Fix compile clang3.8: Moving temp objects prevents copy elision

parent 95d28838
No related branches found
No related tags found
No related merge requests found
......@@ -274,7 +274,7 @@ UnrankedTree RandomTreeFactory::generateUnrankedTree ( int depth, int nodesCount
for ( std::vector < char >::const_iterator it = alphabet.begin ( ); it != alphabet.end ( ); ++it )
treeAlphabet.insert ( alphabet::symbolFrom ( * it ) );
 
UnrankedTree tree ( treeAlphabet, std::move ( root->createUnrankedNode ( ) ) );
UnrankedTree tree ( treeAlphabet, root->createUnrankedNode ( ) );
delete root;
return tree;
}
......@@ -292,7 +292,7 @@ UnrankedPattern RandomTreeFactory::generateUnrankedPattern ( int depth, int node
 
alphabet::Symbol subtreeWildcard ( alphabet::SubtreeWildcardSymbol::SUBTREE_WILDCARD );
treeAlphabet.insert ( subtreeWildcard );
UnrankedPattern tree ( std::move ( subtreeWildcard ), treeAlphabet, std::move ( root->createUnrankedPatternNode ( ) ) );
UnrankedPattern tree ( std::move ( subtreeWildcard ), treeAlphabet, root->createUnrankedPatternNode ( ) );
delete root;
return tree;
}
......@@ -314,7 +314,7 @@ RankedTree RandomTreeFactory::generateRankedTree ( int depth, int nodesCount, in
treeRankedAlphabet.insert ( alphabet::RankedSymbol ( * i, it->first ) );
}
 
RankedTree tree ( treeRankedAlphabet, std::move ( root->createRankedNode ( ) ) );
RankedTree tree ( treeRankedAlphabet, root->createRankedNode ( ) );
delete root;
return tree;
}
......@@ -338,7 +338,7 @@ RankedPattern RandomTreeFactory::generateRankedPattern ( int depth, int nodesCou
 
alphabet::RankedSymbol subtreeWildcard ( alphabet::Symbol ( alphabet::SubtreeWildcardSymbol::SUBTREE_WILDCARD ), 0 );
treeRankedAlphabet.insert ( subtreeWildcard );
RankedPattern tree ( std::move ( subtreeWildcard ), treeRankedAlphabet, std::move ( root->createRankedPatternNode ( ) ) );
RankedPattern tree ( std::move ( subtreeWildcard ), treeRankedAlphabet, root->createRankedPatternNode ( ) );
delete root;
return tree;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment