diff --git a/applications/test/FixedList/Test-FixedList.C b/applications/test/FixedList/Test-FixedList.C index a06abee82f..c501b77bc4 100644 --- a/applications/test/FixedList/Test-FixedList.C +++ b/applications/test/FixedList/Test-FixedList.C @@ -38,6 +38,7 @@ See also #include "List.H" #include "IPstream.H" #include "OPstream.H" +#include using namespace Foam; @@ -48,6 +49,63 @@ int main(int argc, char *argv[]) { argList args(argc, argv); + if (false) + { + FixedList ident; + + auto iter = ident.begin(); + + Info << iter->size() << endl; + + auto riter = ident.rbegin(); + Info << riter->size() << endl; + + auto iter2 = ident.rbegin(); + + iter2 = iter; + } + + { + FixedList ident; + std::iota(ident.begin(), ident.end(), 0); + + // auto iter = ident.begin(); + // + // iter += 5; + // Info << *iter << "< " << endl; + // iter -= 2; + // Info << *iter << "< " << endl; + + // Don't yet bother with making reverse iterators random access + // auto riter = ident.crbegin(); + + // riter += 5; + // Info << *riter << "< " << endl; + // riter += 2; + // Info << *riter << "< " << endl; + + Info<<"Ident:"; + forAllConstIters(ident, iter) + { + Info<<" " << *iter; + } + Info<< nl; + + Info<<"reverse:"; + forAllReverseIters(ident, iter) + { + Info<<" " << *iter; + } + Info<< nl; + + Info<<"const reverse:"; + forAllConstReverseIters(ident, iter) + { + Info<<" " << *iter; + } + Info<< nl; + } + { FixedList list1{1, 2, 3, 4}; diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index 22aa159469..cfb709bf3b 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -47,6 +47,7 @@ See also #include "SubList.H" #include +#include using namespace Foam; @@ -79,6 +80,33 @@ int main(int argc, char *argv[]) #include "setRootCase.H" + { + List