mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: added labelRange += and -= operators
- removed unused decrement() and increment() methods, which provided identical functionality as the ++, +=, --, -= operators.
This commit is contained in:
committed by
Andrew Heather
parent
a9747b90b1
commit
06e709c26f
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011 OpenFOAM Foundation
|
||||
@ -143,6 +143,39 @@ int main(int argc, char *argv[])
|
||||
Info<< nl;
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
range.reset(5, 5);
|
||||
Info<< nl << "Tests on " << range << nl;
|
||||
|
||||
Info<< "first " << range.first() << nl
|
||||
<< "last " << range.last() << nl
|
||||
<< "min " << range.min() << nl
|
||||
<< "max " << range.max() << nl
|
||||
<< "after " << range.after() << nl
|
||||
<< "*begin " << *range.begin() << nl
|
||||
<< "*end " << *range.end() << nl;
|
||||
|
||||
range += 3;
|
||||
Info<< "increase size " << range << nl;
|
||||
|
||||
range -= 3; // Probably not a great idea
|
||||
Info<< "decrese size " << range << nl;
|
||||
|
||||
auto iter = range.begin();
|
||||
|
||||
Info<< "iter: " << *iter << nl;
|
||||
++iter;
|
||||
|
||||
Info<< "iter: " << *iter << nl;
|
||||
|
||||
iter += 3;
|
||||
Info<< "iter: " << *iter << nl;
|
||||
}
|
||||
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user