UList, FixedList: Correct swap member function

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1787
This commit is contained in:
Henry Weller
2015-07-15 12:10:05 +01:00
parent 30af1cdbc4
commit 3599b8918b
5 changed files with 42 additions and 21 deletions

View File

@ -22,8 +22,13 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-List
Description
Simple tests and examples of use of List
See Also
Foam::List
\*---------------------------------------------------------------------------*/
@ -75,6 +80,14 @@ int main(int argc, char *argv[])
Info<< "list2: " << list2 << nl
<< "list3: " << list3 << endl;
List<vector> list4(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());
List<vector> list5(IStringStream("((5 3 1) (10 2 2) (8 1 0))")());
Info<< "list4: " << list4 << nl
<< "list5: " << list5 << endl;
list4.swap(list5);
Info<< "Swapped via the swap() method" << endl;
Info<< "list4: " << list4 << nl
<< "list5: " << list5 << endl;
// Subset
const labelList map(IStringStream("2 (0 2)")());