From 0a4c8f72662fcc9b1de8033243300746ca2f36ee Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 15 Jun 2010 11:02:23 +0200 Subject: [PATCH] ENH: add assignment from UIndirectList to DynamicList --- .../test/DynamicList/DynamicListTest.C | 105 +++++++++++++----- .../Lists/DynamicList/DynamicList.H | 4 + .../Lists/DynamicList/DynamicListI.H | 68 ++++++++---- .../Lists/UIndirectList/UIndirectList.H | 4 +- 4 files changed, 127 insertions(+), 54 deletions(-) diff --git a/applications/test/DynamicList/DynamicListTest.C b/applications/test/DynamicList/DynamicListTest.C index 822ee3cacb..a4e3ae25ff 100644 --- a/applications/test/DynamicList/DynamicListTest.C +++ b/applications/test/DynamicList/DynamicListTest.C @@ -31,6 +31,41 @@ Description using namespace Foam; +template +void printInfo +( + const word& tag, + const UList& lst, + const bool showSize = false +) +{ + Info<< "<" << tag; + if (showSize) + { + Info<< " size=\"" << lst.size() << "\""; + } + Info<< ">" << lst << "" << endl; +} + + +template +void printInfo +( + const word& tag, + const DynamicList& lst, + const bool showSize = false +) +{ + Info<< "<" << tag; + if (showSize) + { + Info<< " size=\"" << lst.size() + << "\" capacity=\"" << lst.capacity() << "\""; + } + Info<< ">" << lst << "" << endl; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: @@ -104,10 +139,8 @@ int main(int argc, char *argv[]) List