今天观看 cygwin list 的源码,该文件位于C:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\include\c++\bits\stl_list.h,
竟然发现:

      /**
       *  @brief  Remove element at given position.
       *  @param  position  Iterator pointing to element to be erased.
       *  @return  An iterator pointing to the next element (or end()).
       *
       *  This function will erase the element at the given position and thus
       *  shorten the %list by one.
       *
       *  Due to the nature of a %list this operation can be done in
       *  constant time, and only invalidates iterators/references to
       *  the element being removed.  The user is also cautioned that
       *  this function only erases the element, and that if the element
       *  is itself a pointer, the pointed-to memory is not touched in
       *  any way.  Managing the pointer is the user's responsibilty.
       */
      iterator
      erase(iterator __position);

erase竟然没有定义,why? 十分不解!!!
我再观看vc2005的list的源码,erase 的实现密密麻麻!!1
posted on 2006-05-24 10:41 ZerroSong 阅读(159) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航:   博客园   博客园最新博文   博问   管理


统计