mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: update List and DynamicList methods (issue #595)
- improve functional compatibility with DynList (remove methods) * eg, remove an element from any position in a DynamicList * reduce the number of template parameters * remove/subset regions of DynamicList - propagate Swap template specializations for lists, hashtables - move construct/assignment to various containers. - add find/found methods for FixedList and UList for a more succinct (and clearer?) usage than the equivalent global findIndex() function. - simplify List_FOR_ALL loops
This commit is contained in:
@ -324,6 +324,34 @@ int main()
|
||||
<< nl;
|
||||
|
||||
|
||||
// Start again with new value
|
||||
table2.set("ada", 14.0);
|
||||
table2.set("aeq", 15.0);
|
||||
table2.set("aaw", 16.0);
|
||||
|
||||
Info<< nl << "input values" << nl;
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"global Swap function" << nl;
|
||||
Swap(table1, table2);
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"swap method" << nl;
|
||||
table1.swap(table2);
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"transfer" << nl;
|
||||
table1.transfer(table2);
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"move assign" << nl;
|
||||
table2 = std::move(table1);
|
||||
Info<<"table1 = " << table1 << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<<"move construct" << nl;
|
||||
HashTable<scalar> table1b(std::move(table2));
|
||||
Info<<"table1 = " << table1b << nl <<"table2 = " << table2 << nl;
|
||||
|
||||
Info<< "\nDone\n";
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user