ENH: identityOp as equivalent to std::identity (C++20)

- similar to how noOp was defined, but with perfect forwarding

STYLE: combine Swap into stdFoam

STYLE: capitalize FileOp, NegateOp template parameters
This commit is contained in:
Mark Olesen
2022-03-13 18:12:58 +01:00
parent ed73bcbc33
commit 327c43f3e8
39 changed files with 221 additions and 305 deletions

View File

@ -33,7 +33,7 @@ License
#include "IOstreams.H"
#include "StringStream.H"
#include "ListOps.H"
#include "flipOp.H"
#include "StringListOps.H"
using namespace Foam;
@ -216,7 +216,7 @@ int main()
(
table1.keys().begin(),
table1.keys().end(),
noOp{}
identityOp{}
)
);
sort(sortKeys);

View File

@ -34,7 +34,7 @@ Description
#include "argList.H"
#include "ITstream.H"
#include "ListOps.H"
#include "flipOp.H"
#include "StringListOps.H"
using namespace Foam;
@ -172,7 +172,7 @@ int main(int argc, char *argv[])
(
stringInput.cbegin(),
stringInput.cend(),
Foam::noOp{}
Foam::identityOp{}
)
);

View File

@ -85,7 +85,7 @@ int main(int argc, char *argv[])
{
const mapDistribute& faceMap = map.faceMap();
pointField fc(mesh.faceCentres());
faceMap.distribute(fc, noOp());
faceMap.distribute(fc, identityOp());
Pout<< "Construct size:" << faceMap.constructSize() << endl;
forAll(distributedMesh.faceCentres(), facei)
{
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
{
const mapDistribute& cellMap = map.cellMap();
pointField cc(mesh.cellCentres());
cellMap.distribute(cc, noOp());
cellMap.distribute(cc, identityOp());
Pout<< "Construct size:" << cellMap.constructSize() << endl;
forAll(distributedMesh.cellCentres(), celli)
{
@ -131,7 +131,7 @@ int main(int argc, char *argv[])
{
const mapDistribute& pointMap = map.pointMap();
pointField pc(mesh.points());
pointMap.distribute(pc, noOp());
pointMap.distribute(pc, identityOp());
Pout<< "Construct size:" << pointMap.constructSize() << endl;
forAll(distributedMesh.points(), pointi)
{

View File

@ -614,7 +614,7 @@ void testEdgeFlip2(const polyMesh& mesh, Random& rndGen)
edgePointCombineOp(),
PointPair(point::max, point::max),
edgePointTransformOp(),
noOp()
identityOp()
);
forAll(fld, edgeI)

View File

@ -51,7 +51,6 @@ Description
#include "wallPolyPatch.H"
#include "symmetryPolyPatch.H"
#include "oldCyclicPolyPatch.H"
#include "Swap.H"
#include "IFstream.H"
#include "readHexLabel.H"

View File

@ -45,7 +45,6 @@ SourceFiles
#include "List.H"
#include "globalIndex.H"
#include "Pstream.H"
#include "Swap.H"
#include "InfoProxy.H"
#include "tetCell.H"
#include "typeInfo.H"