Fix GenericObjectCache::update() on GCC and Clang
Fixes #Bug 7858 in GenericObjectCache::update() on GCC and Clang on Debian.
Replaces the std::erase_if loop by a while loop and adds a more clear and doxygen-friendly documentation to the function.
Tested by running --gtest_filter='ResourceGenericObjectCacheTest*.
Fixes #7858 (closed)
Closes #7858 (closed)