- 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:
@ -302,7 +302,7 @@ bool Foam::waveModel::readDict(const dictionary& overrideDict)
|
||||
readIfPresent("U", UName_);
|
||||
readIfPresent("alpha", alphaName_);
|
||||
|
||||
nPaddle_ = get<label>("nPaddle");
|
||||
readEntry("nPaddle", nPaddle_);
|
||||
if (nPaddle_ < 1)
|
||||
{
|
||||
FatalIOErrorInFunction(*this)
|
||||
|
||||
Reference in New Issue
Block a user