Created
January 16, 2017 05:04
-
-
Save YaoC/84c04b703ecc8f432b1f057a03b8d5e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class KEY,class T> | |
const T& ArrayMap<KEY,T>::operator [] (const KEY& key) const { | |
int i = index_of(key); | |
if (i != -1) | |
return map[i].second; | |
std::ostringstream answer; | |
answer << "ArrayMap::operator []: key(" << key << ") not in Map"; | |
throw KeyError(answer.str()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment