dictionary gets xfer constructor and transfer() method(s)

This commit is contained in:
Mark Olesen
2009-01-02 15:50:32 +01:00
parent a010121427
commit 5e90a0ddc9
8 changed files with 125 additions and 90 deletions

View File

@ -42,11 +42,20 @@ using namespace Foam;
int main(int argc, char *argv[])
{
{
dictionary dict(IFstream("testDict")());
Info<< "dict: " << dict << nl
<< "toc: " << dict.toc() << nl
<< "keys: " << dict.keys() << nl
<< "patterns: " << dict.keys(true) << endl;
dictionary dict1(IFstream("testDict")());
Info<< "dict1: " << dict1 << nl
<< "toc: " << dict1.toc() << nl
<< "keys: " << dict1.keys() << nl
<< "patterns: " << dict1.keys(true) << endl;
dictionary dict2(dict1.transfer());
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << nl
<< "dict2.toc(): " << dict2.name() << " " << dict2.toc() << endl;
// copy back
dict1 = dict2;
Info<< "dict1.toc(): " << dict1.name() << " " << dict1.toc() << endl;
}

View File

@ -89,6 +89,12 @@ baz
}
"anynumber.*"
{
$active
}
// this should work
#remove active