Fix -Wredundant-move warnings, 2nd try

std::move is redundant when it is used to return a local object from a function (eg return std::move(local)): indeed, returning a local object from a function implicitly moves it. Moreover using std::move this way
See https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rf-return-move-local
However, in order to avoid -Wreturn-std-move as well, a Base object is move-constructed
from Derived when required.
This commit is contained in:
howetuft
2019-11-16 10:41:05 +01:00
committed by wmayer
parent 5807ee2022
commit f1e3b7a166
6 changed files with 23 additions and 13 deletions

View File

@@ -236,7 +236,7 @@ TopoDS_Shape FaceMakerCheese::makeFace(const std::vector<TopoDS_Wire>& w)
builder.Add(comp, aFace);
}
return std::move(comp);
return TopoDS_Shape(std::move(comp));
}
else {
return TopoDS_Shape(); // error