Created
January 16, 2017 05:06
-
-
Save YaoC/fa0b9c59a90665e7588054762720be94 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
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