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:
@ -223,6 +223,31 @@ int main(int argc, char *argv[])
|
||||
Info << i << endl;
|
||||
}
|
||||
|
||||
Info<< nl << "Test swapping, moving etc." << nl;
|
||||
setA.insert({ "some", "more", "entries" });
|
||||
|
||||
Info<< "input" << nl;
|
||||
Info<< "setA: " << setA << nl;
|
||||
|
||||
wordHashSet setA1(std::move(setA));
|
||||
|
||||
Info<< "move construct" << nl;
|
||||
Info<< "setA: " << setA << nl
|
||||
<< "setA1: " << setA1 << nl;
|
||||
|
||||
|
||||
wordHashSet setB1;
|
||||
Info<< "move assign" << nl;
|
||||
setB1 = std::move(setA1);
|
||||
|
||||
Info<< "setA1: " << setA1 << nl
|
||||
<< "setB1: " << setB1 << nl;
|
||||
|
||||
setB1.swap(setA1);
|
||||
|
||||
Info<< "setA1: " << setA1 << nl
|
||||
<< "setB1: " << setB1 << nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user