BUG: FixedList '<' operator using a template parameter (fixes #458)

- cannot use comparison of list sizes. Okay for UList, but not here.

STYLE:
- don't need two iterators for the '<' comparison, can just access
  internal storage directly
This commit is contained in:
Mark Olesen
2017-04-27 01:30:50 +02:00
parent f1ca89463f
commit 5514471c15
3 changed files with 20 additions and 25 deletions

View File

@ -33,7 +33,6 @@ See also
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "IOstreams.H"
#include "FixedList.H"
#include "IFstream.H"
#include "OFstream.H"
@ -64,6 +63,15 @@ int main(int argc, char *argv[])
Info<< "list2:" << list2
<< " hash:" << FixedList<label, 4>::Hash<>()(list2) << endl;
// Using FixedList for content too
{
List<FixedList<label, 4>> twolists{list, list2};
Info<<"List of FixedList: " << flatOutput(twolists) << endl;
sort(twolists);
// outer-sort only
Info<<"sorted FixedList : " << flatOutput(twolists) << endl;
}
Info<< "list: " << list << nl
<< "list2: " << list2 << endl;
list.swap(list2);