// Copyleft: Sathiamoorthy Manoharan. #include #include class CacheEntry { public: int id; std::string item; }; const int NoOfCachedItems = 5; static std::vector cacheSlot(NoOfCachedItems); bool DoesCacheContain(int myId) { bool rval = false; int where2look = myId % NoOfCachedItems; if ( myId == cacheSlot[where2look].id ) { rval = true; } return rval; }