mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: define IOobjectList::csorted(), deprecate some sorted() const methods
- prefer csorted() method for const access since it ensures that the return values are also const pointers (for example) even if the object itself can be accessed as a non-const. - the csorted() method already existed for HashTable and objectRegistry, but now added to IOobjectList for method name consistency (even although the IOobjectList only has a const-access version) ENH: objectRegistry with templated strict lookup - for lookupClass and csorted/sorted. Allows isType restriction as a compile-time specification.
This commit is contained in:
@ -75,8 +75,8 @@ int main()
|
||||
}
|
||||
|
||||
|
||||
Info<< "\ntable1 sorted() :" << endl;
|
||||
for (const auto& iter : table1.sorted())
|
||||
Info<< "\ntable1 csorted() :" << endl;
|
||||
for (const auto& iter : table1.csorted())
|
||||
{
|
||||
Info<< " " << iter.key() << " => " << iter.val() << nl;
|
||||
}
|
||||
@ -100,7 +100,7 @@ int main()
|
||||
}
|
||||
|
||||
Info<< "\nInplace modified - via sorted() access :" << endl;
|
||||
for (const auto& iter : table1.sorted())
|
||||
for (const auto& iter : table1.csorted())
|
||||
{
|
||||
Info<< " " << iter.key() << " => " << iter.val() << nl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user