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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user