mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: remove reliance on the Xfer class (issue #639)
This class is largely a pre-C++11 holdover. It is now possible to simply use move construct/assignment directly. In a few rare cases (eg, polyMesh::resetPrimitives) it has been replaced by an autoPtr.
This commit is contained in:
@ -194,13 +194,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
printInfo("dlC", dlC, true);
|
||||
|
||||
List<label> lstB(dlC.xfer());
|
||||
List<label> lstB(std::move(dlC));
|
||||
|
||||
Info<< "Transferred to normal list via the xfer() method" << endl;
|
||||
Info<< "Move construct to normal list" << endl;
|
||||
printInfo("lstB", lstB, true);
|
||||
printInfo("dlC", dlC, true);
|
||||
|
||||
DynamicList<label> dlD(lstB.xfer());
|
||||
DynamicList<label> dlD(std::move(lstB));
|
||||
|
||||
Info<< "Transfer construct from normal list" << endl;
|
||||
printInfo("lstB", lstB, true);
|
||||
@ -279,7 +279,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "list in: " << flatOutput(list1) << nl
|
||||
<< "list out: " << flatOutput(list2) << endl;
|
||||
|
||||
input2 = std::move(identity(15));
|
||||
input2 = identity(15); // don't need std::move() on temporary object
|
||||
list2 = std::move(input2);
|
||||
Info<< "list in: " << flatOutput(input2) << nl
|
||||
<< "list out: " << flatOutput(list2) << endl;
|
||||
|
||||
Reference in New Issue
Block a user