Exemple #1
0
HashMap<KeyType,vector<ValueType>>
  operator * (const HashMap<KeyType,ValueType> &hm1,
  			  const HashMap<KeyType,ValueType> &hm2)
{

	HashMap<KeyType,vector<ValueType>>
	  result(hm2.size(),hm2.getHashFunction());

	for (const KeyType &key : hm1)
	{
		//key е в сечението на ключовете
		if (hm2.containsKey (key))
		{
			result[key].push_back(hm1[key]);
			result[key].push_back(hm2[key]);
		}
	}
	return result;
}