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:
Mark Olesen
2017-09-20 17:20:54 +02:00
parent 68e7533847
commit 049617d037
74 changed files with 3205 additions and 1169 deletions

View File

@ -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;
}