Make associative container operators inline friend

Jonathan Wakely jwakely@redhat.com
Thu Oct 4 11:28:00 GMT 2018


On 04/10/18 07:37 +0200, François Dumont wrote:
>Here is the cleanup version.
>
>    * include/bits/stl_tree.h
>    (_Rb_tree_iterator<>::operator==): Make inline friend.
>    (_Rb_tree_iterator<>::operator!=): Likewise.
>    (_Rb_tree_const_iterator<>::operator==): Likewise.
>    (_Rb_tree_const_iterator<>::operator!=): Likewise.
>    (operator==(const _Rb_tree_iterator<>&,
>    const _Rb_tree_const_iterator&)): Remove.
>    (operator!=(const _Rb_tree_iterator<>&,
>    const _Rb_tree_const_iterator&)): Remove.
>    (operator==(const _Rb_tree<>&, const _Rb_tree<>&)): Make inline friend.
>    (operator<(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
>    (operator!=(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise and 
>deprecate.

Nice.

>    (operator>(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
>    (operator<=(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
>    (operator>=(const _Rb_tree<>&, const _Rb_tree<>&)): Likewise.
>    * include/debug/map.h (map<>::erase(const_iterator, const_iterator)):
>    Compare __victim with _Base::cend().
>    * include/debug/multimap.h (multimap<>::erase(const_iterator, 
>const_iterator)):
>    Likewise.
>    * include/debug/set.h (set<>::erase(const_iterator, const_iterator)):
>    Compare __victim with _Base::cend().
>    * include/debug/multiset.h (multiset<>::erase(const_iterator, 
>const_iterator)):
>    Likewise.
>
>Tested under Linux x86_64.
>
>Ok to commit ?

Yes, thanks very much.




More information about the Libstdc++ mailing list