diff --git a/applications/test/List/Test-List.C b/applications/test/List/Test-List.C index ec4ec9e5a1..945b0e9998 100644 --- a/applications/test/List/Test-List.C +++ b/applications/test/List/Test-List.C @@ -48,6 +48,23 @@ See also #include #include +#include + +namespace Foam +{ + +// Verify inheritance +class MyStrings +: + public List +{ +public: + + using List::List; +}; + +} // end namespace Foam + using namespace Foam; @@ -66,6 +83,14 @@ void testFind(const T& val, const ListType& lst) } +void printMyString(const UList& lst) +{ + MyStrings slist2(lst); + + Info<::createList + ( + labels, + [](const label& val){ return scalar(1.5*val); } + ); + Info<< "scalars: " << flatOutput(scalars) << endl; + } + + { + auto vectors = List::createList + ( + labels, + [](const label& val){ return vector(1.2*val, -1.2*val, 0); } + ); + Info<< "vectors: " << flatOutput(vectors) << endl; + } + + { + auto longs = List::createList + ( + labels, + [](const label& val){ return val; } + ); + Info<< "longs: " << flatOutput(longs) << endl; + } + { + auto negs = List