YXD's Blog

Home Contact Syndicate this Site (RSS 2.0) Syndicate this Site (Atom) 登录
  随笔 18 :: 收藏 1 :: 评论 0 :: 寻迹: 1

随笔

随笔归档

收藏

图库

Friends' Blogs

from cndev

Technical Blogs

typedef ::std::vector< int > IntArray;

...

IntArray theInts;

...

IntArray::iterator it1, it2;

....

::std::swap( it1, it2 );// error!, should be ::std::swap( *it1, *it2 );

 

很早以前曾犯的另一个错误:

IntArray theInts;

...

int* g_pTheInt;

...

g_pTheInt = &( *it ) or it;//无效,::std::vector会reallocate。。。

 

自醒。。。

发表于 @ 2004-11-25 19:03

Feedback

尚无评论

发表评论

标题:  
署名:  
链接:
内容:
验证码: