Skip to content

Instantly share code, notes, and snippets.

@YaoC
Created January 16, 2017 05:06
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/fa0b9c59a90665e7588054762720be94 to your computer and use it in GitHub Desktop.
Save YaoC/fa0b9c59a90665e7588054762720be94 to your computer and use it in GitHub Desktop.
template<class KEY,class T>
T& ArrayMap<KEY,T>::operator [] (const KEY& key) {
int i = index_of(key);
if (i != -1)
return map[i].second;
this->ensure_length(used+1);
map[used++] = Entry(key,T());
++mod_count;
return map[used-1].second;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment