![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
文章平均质量分 52
steven216
这个作者很懒,什么都没留下…
展开
-
map 效率问题
<br />当关乎效率时应该在map::operator[]和map-insert之间仔细选择<br /><br />class Widget {<br />public:<br />Widget();<br />Widget(double weight);<br />Widget& operator=(double weight);<br />...<br />}<br /><br />map<int, Widget> m;<br />m[1] = 1.50;<br /> <br /><br />表达式m转载 2011-04-17 11:41:00 · 3004 阅读 · 0 评论 -
vector 删除问题
int main(int argc, const char* argv[]){vector v;v.push_back(1);v.push_back(2);v.push_back(3);vector::iterator iterBeg = v.begin();vector::iterator iterEnd = v.end();while(iterBeg != v.end()){iterBeg = v.erase(iterBeg);}vector().swap(v);system("pause");retu原创 2011-04-16 22:21:00 · 538 阅读 · 0 评论