ENH: add move/swap semantics to string types and regExp

- move append() single element to List and DynamicList

ENH: add stringOps::count to avoid unnecessary string conversions
This commit is contained in:
Mark Olesen
2017-11-05 13:26:10 +01:00
parent cae8a894cd
commit e1b71c028c
24 changed files with 525 additions and 122 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -44,7 +44,7 @@ int main(int argc, char *argv[])
Info<< "Test expressions:" << rawList << endl;
IOobject::writeDivider(Info) << endl;
List<string> groups;
List<std::string> groups;
// Report matches:
forAll(rawList, elemI)
@ -74,7 +74,23 @@ int main(int argc, char *argv[])
Info<< "false";
}
}
Info<< endl;
if (false)
{
regExp re2(std::move(re));
Info<<"move construct: " << re.exists() << "/" << re2.exists()
<< endl;
re = std::move(re2);
Info<<"move assign: " << re.exists() << "/" << re2.exists()
<< endl;
re.swap(re2);
Info<<"swap: " << re.exists() << "/" << re2.exists()
<< endl;
}
}
Info<< nl << "test regExp(const char*) ..." << endl;