STYLE: use range-for when looping dictionary entries.

- as part of the cleanup of dictionary access methods (c6520033c9)
  made the dictionary class single inheritance from IDLList<entry>.

  This eliminates any ambiguities for iterators and allows
  for simple use of range-for looping.

  Eg,
      for (const entry& e : topDict))
      {
          Info<< "entry:" << e.keyword() << " is dict:" << e.isDict() << nl;
      }

   vs

      forAllConstIter(dictionary, topDict, iter))
      {
          Info<< "entry:" << iter().keyword()
              << " is dict:" << iter().isDict() << nl;
      }
This commit is contained in:
Mark Olesen
2018-10-19 13:08:24 +02:00
parent 4e04c1966f
commit 07dafe7b0b
60 changed files with 636 additions and 653 deletions

View File

@ -346,14 +346,15 @@ Foam::fileName Foam::ensightSurfaceWriter::writeCollated
<< "VARIABLE" << nl;
const dictionary& fieldsDict = dict.subDict("fields");
forAllConstIter(dictionary, fieldsDict, iter)
for (const entry& dEntry : fieldsDict)
{
const dictionary& subDict = iter().dict();
const dictionary& subDict = dEntry.dict();
const word fieldType(subDict.get<word>("type"));
const word varName = subDict.lookupOrDefault
(
"name",
iter().keyword() // fieldName as fallback
dEntry.keyword() // fieldName as fallback
);
osCase