All pastes #268612 Raw Edit

Someone

public text v1 · immutable
·published 2006-12-05 21:19 UTC
rendered paste body
    template<typename Z, class T>
    T getEntryFromHashMap (Z id, hash_map<Z, T>* hashMap)
    {
        // Search the entry in the hashMap
        if (hashMap)
        {
            hash_map<Z, T>::iterator hashMapIterator;
            hashMapIterator = hashMap->find (id);
            if (hashMapIterator != hashMap->end())
            {
                // Found it
                return hashMapIterator->second;
            }
        }

        return NULL;
    }