map.cpp
来自「常用数据结构集体实现」· C++ 代码 · 共 24 行
CPP
24 行
#ifndef MAP_CPP_#define MAP_CPP_#include "Except.h"#include "StartConv.h"template <class KeyType, class ValueType, class Compare>ValueType & map<KeyType,ValueType,Compare>::operator[] ( const KeyType & key ){ kvpair x( key ); iterator itr = theSet.find( x ); if( itr == theSet.end( ) ) itr = theSet.insert( x ).first; return *(ValueType *) &( (*itr).second ); // const_cast is preferred}#include "EndConv.h"#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?