This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [MAILER-DAEMON@sourceware.cygnus.com: failure notice]


On Wed, Jul 05, 2000 at 04:39:50AM -0400, brent verner wrote:
> On 05 Jul 2000 at 11:24 (+0300), Yotam Medini wrote:
> | 
> | It seems that Josuttis's book, SGI's STL and thus gcc's libstdc++ have 
> | a _wrong_  void  return type  for:
> | 
> |   void  std::map<T>::erase(map<T>::iterator pos);
> |   void  std::map<T>::erase(map<T>::iterator first, map<T>::iterator last);
> | 
> | where they should return an iterator to past what was erased:
> | 
> |   map<T>::iterator  std::map<T>::erase(map<T>::iterator pos);
> |   map<T>::iterator  std::map<T>::erase(map<T>::iterator first, 
> | 				       map<T>::iterator last);
> | Please clarify and/or fix.
> 
> Where did you get your info?  My copy of 14882 says this about map<>.

1.  In ISO/IEC 14882:1998(E)
    23.1.1 Sequences, page 463 (pdf version)

    7 The iterator returned from a.erase(q) points to the element
      immediately following q prior to the ele­ment being
      erased. If no such element exists, a.end() is returned.
      
    8 The iterator returned by a.erase(q1,q2) points to the
      element pointed to by q2 prior to any elements being
      erased. If no such element exists, a.end() is returned.

2.  http://www.dinkumware.com/htm_cpl/map.html#map::erase


> 
> 23.3.1.2 element access:
> 
>   void      erase(iterator position);
>   size_type erase(const key_type& x);
>   void      erase(iterator first, iterator last);
> 
> ...
> Damon Brent Verner                        o      _     _         _
> Cracker Jack? Surprise Certified  _o     /\_   _ \\o  (_)\__/o  (_)
> brent@rcfile.org                _< \_   _>(_) (_)/<_    \_| \   _|/' \/
> brent@linux1.org               (_)>(_) (_)        (_)   (_)    (_)'  _\o_


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]