mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: provide HashTable::iterator::found() method
- This can be used as a convenient alternative to comparing against end().
Eg,
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(methodType);
if (cstrIter.found())
{
...
}
vs.
if (cstrIter != dictionaryConstructorTablePtr_->end())
{
...
}
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -257,6 +257,14 @@ Foam::HashTable<T, Key, Hash>::iteratorBase::increment()
|
||||
}
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
inline bool
|
||||
Foam::HashTable<T, Key, Hash>::iteratorBase::found() const
|
||||
{
|
||||
return entryPtr_;
|
||||
}
|
||||
|
||||
|
||||
template<class T, class Key, class Hash>
|
||||
inline
|
||||
const Key& Foam::HashTable<T, Key, Hash>::iteratorBase::key() const
|
||||
|
||||
Reference in New Issue
Block a user