The SimpleCxxLib package


#include "hashmap.h"

This file exports the HashMap class, which stores a set of key-value pairs.
Class
HashMap<KeyType,ValueType> This class implements an efficient association between keys and values.
Function
hashCode(key) Returns a hash code for the specified key, which is always a nonnegative integer.

Function detail


int hashCode(const string & key);
int hashCode(int key);
int hashCode(char key);
int hashCode(long key);
int hashCode(double key);
Returns a hash code for the specified key, which is always a nonnegative integer. This function is overloaded to support all of the primitive types and the C++ string type.

Usage:

int hash = hashCode(key);