mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: fileName hasPath(), removePath() methods
- improved move constructors/assignments for fileName, string, etc
This commit is contained in:
@ -36,6 +36,7 @@ Description
|
||||
#include "uint.H"
|
||||
#include "scalar.H"
|
||||
#include "Switch.H"
|
||||
#include "fileName.H"
|
||||
#include "stringList.H"
|
||||
|
||||
using namespace Foam;
|
||||
@ -64,6 +65,34 @@ int main(int argc, char *argv[])
|
||||
subDict.add("value2", "test2");
|
||||
dict.add("FOAM_RUN", subDict);
|
||||
|
||||
if (false)
|
||||
{
|
||||
typedef std::string inputType;
|
||||
typedef string outputType;
|
||||
|
||||
inputType in1("move-construct-from");
|
||||
|
||||
Info<<"move construct from " << in1.length() << nl;
|
||||
|
||||
outputType out1(std::move(in1));
|
||||
|
||||
Info<<"after move construct "
|
||||
<< out1.size() << ", " << in1.size() << nl;
|
||||
|
||||
in1 = "move-assign-from";
|
||||
out1 = "some-text-rubbish";
|
||||
out1.resize(10);
|
||||
|
||||
Info<<"move assign from " << in1.length() << nl;
|
||||
|
||||
out1 = std::move(in1);
|
||||
|
||||
Info<<"after move assign "
|
||||
<< out1.size() << ", " << in1.size() << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// basic expansions
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user