This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Make std::forward_list iterator operators inline friend


On 10/10/18 22:55 +0200, François Dumont wrote:
Same patch as for std::list iterators. I only additionally move doc on those operators.

I also avoid redefining some typedef that are already defined in _Fwd_list_base<>.

    * include/bits/forward_list.h
    (_Fwd_list_iterator<>::operator==): Replace member function with inline
    friend.
    (_Fwd_list_iterator<>::operator!=): Likewise.
    (_Fwd_list_const_iterator<>::operator==): Likewise.
    (_Fwd_list_const_iterator<>::operator!=): Likewise.
    (operator==(const _Fwd_list_iterator<>&,
    const _Fwd_list_const_iterator<>&)): Remove.
    (operator!=(const _Fwd_list_iterator<>&,
    const _Fwd_list_const_iterator<>&)): Remove.
    (forward_list<>::_Node): Take typedef from base type.
    (forward_list<>::iterator): Likewise.
    (forward_list<>::const_iterator): Likewise.

Tested under Linux x86_64.

Ok to commit ?

OK, thanks.



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