diff --git a/src/mongo/util/lru_cache.h b/src/mongo/util/lru_cache.h index 5feea1a0bc3..b59f66e262d 100644 --- a/src/mongo/util/lru_cache.h +++ b/src/mongo/util/lru_cache.h @@ -131,7 +131,10 @@ public: */ const_iterator cfind(const K& key) const { auto it = this->_map.find(key); - return (it == this->_map.end()) ? this->end() : it->second; + // TODO(SERVER-28890): Remove the function-style cast when MSVC's + // `std::list< ... >::iterator` implementation doesn't conflict with their `/Zc:ternary` + // flag support . + return (it == this->_map.end()) ? this->end() : const_iterator(it->second); } /**