Skip to content

Instantly share code, notes, and snippets.

@YaoC
Created January 16, 2017 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YaoC/84c04b703ecc8f432b1f057a03b8d5e5 to your computer and use it in GitHub Desktop.
Save YaoC/84c04b703ecc8f432b1f057a03b8d5e5 to your computer and use it in GitHub Desktop.
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