mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: add const_cast when deleting pointers in objectRegistry
- makes the intention clearer, allows for future tightening of iterator access rules.
This commit is contained in:
committed by
Andrew Heather
parent
a1ee14690b
commit
2259fd845c
@ -370,7 +370,7 @@ bool Foam::objectRegistry::erase(const iterator& iter)
|
|||||||
|
|
||||||
if (iter.found())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
regIOobject* ptr = iter.val();
|
regIOobject* ptr = const_cast<iterator&>(iter).val();
|
||||||
|
|
||||||
const bool ok = HashTable<regIOobject*>::erase(iter);
|
const bool ok = HashTable<regIOobject*>::erase(iter);
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ bool Foam::objectRegistry::erase(const word& key)
|
|||||||
|
|
||||||
Foam::label Foam::objectRegistry::erase(std::initializer_list<word> keys)
|
Foam::label Foam::objectRegistry::erase(std::initializer_list<word> keys)
|
||||||
{
|
{
|
||||||
return eraseImpl(*this, keys.begin(), keys.end());
|
return eraseImpl(*this, keys.begin(), keys.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user