ENH: avoid readScalar, readLabel etc from dictionary (#762, #1033)

- use the dictionary 'get' methods instead of readScalar for
  additional checking

     Unchecked:  readScalar(dict.lookup("key"));
     Checked:    dict.get<scalar>("key");

- In templated classes that also inherit from a dictionary, an additional
  'template' keyword will be required. Eg,

     this->coeffsDict().template get<scalar>("key");

  For this common use case, the predefined getXXX shortcuts may be
  useful. Eg,

     this->coeffsDict().getScalar("key");
This commit is contained in:
Mark Olesen
2018-10-12 08:14:47 +02:00
parent 990d00d40d
commit 8eddcc072a
335 changed files with 1007 additions and 1127 deletions

View File

@ -751,7 +751,7 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
forAll(patches, p)
{
label totalPatchSize = patchDicts[p].get<label>("nFaces");
const label totalPatchSize = patchDicts[p].get<label>("nFaces");
if
(

View File

@ -816,7 +816,7 @@ void Foam::conformalVoronoiMesh::writeMesh
forAll(patches, p)
{
label totalPatchSize = patchDicts[p].get<label>("nFaces");
const label totalPatchSize = patchDicts[p].get<label>("nFaces");
if
(