Commit 5defb0f2 by Paolo Carlini Committed by Paolo Carlini

stl_iterator.h (operator-(const reverse_iterator<>&, const reverse_iterator<>&),…

stl_iterator.h (operator-(const reverse_iterator<>&, const reverse_iterator<>&), [...]): Use the auto -> return type syntax, implement DR 685.

2008-10-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_iterator.h (operator-(const reverse_iterator<>&,
	const reverse_iterator<>&), operator-(const __normal_iterator<>&,
	const __normal_iterator<>&), operator-(const move_iterator<>&,
	const move_iterator<>&)): Use the auto -> return type syntax,
	implement DR 685.

From-SVN: r140937
parent ebca2d91
2008-10-07 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_iterator.h (operator-(const reverse_iterator<>&,
const reverse_iterator<>&), operator-(const __normal_iterator<>&,
const __normal_iterator<>&), operator-(const move_iterator<>&,
const move_iterator<>&)): Use the auto -> return type syntax,
implement DR 685.
2008-10-06 Jason Merrill <jason@redhat.com> 2008-10-06 Jason Merrill <jason@redhat.com>
* config/abi/pre/gnu.ver: Update char16/32_t manglings. * config/abi/pre/gnu.ver: Update char16/32_t manglings.
......
...@@ -365,9 +365,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -365,9 +365,17 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return !(__x < __y); } { return !(__x < __y); }
template<typename _IteratorL, typename _IteratorR> template<typename _IteratorL, typename _IteratorR>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
// DR 685.
inline auto
operator-(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y)
-> decltype(__y.base() - __x.base())
#else
inline typename reverse_iterator<_IteratorL>::difference_type inline typename reverse_iterator<_IteratorL>::difference_type
operator-(const reverse_iterator<_IteratorL>& __x, operator-(const reverse_iterator<_IteratorL>& __x,
const reverse_iterator<_IteratorR>& __y) const reverse_iterator<_IteratorR>& __y)
#endif
{ return __y.base() - __x.base(); } { return __y.base() - __x.base(); }
//@} //@}
...@@ -835,9 +843,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) ...@@ -835,9 +843,17 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// operators but also operator- must accept mixed iterator/const_iterator // operators but also operator- must accept mixed iterator/const_iterator
// parameters. // parameters.
template<typename _IteratorL, typename _IteratorR, typename _Container> template<typename _IteratorL, typename _IteratorR, typename _Container>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
// DR 685.
inline auto
operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs)
-> decltype(__lhs.base() - __rhs.base())
#else
inline typename __normal_iterator<_IteratorL, _Container>::difference_type inline typename __normal_iterator<_IteratorL, _Container>::difference_type
operator-(const __normal_iterator<_IteratorL, _Container>& __lhs, operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
const __normal_iterator<_IteratorR, _Container>& __rhs) const __normal_iterator<_IteratorR, _Container>& __rhs)
#endif
{ return __lhs.base() - __rhs.base(); } { return __lhs.base() - __rhs.base(); }
template<typename _Iterator, typename _Container> template<typename _Iterator, typename _Container>
...@@ -1001,10 +1017,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -1001,10 +1017,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
const move_iterator<_IteratorR>& __y) const move_iterator<_IteratorR>& __y)
{ return !(__x < __y); } { return !(__x < __y); }
// DR 685.
template<typename _IteratorL, typename _IteratorR> template<typename _IteratorL, typename _IteratorR>
inline typename move_iterator<_IteratorL>::difference_type inline auto
operator-(const move_iterator<_IteratorL>& __x, operator-(const move_iterator<_IteratorL>& __x,
const move_iterator<_IteratorR>& __y) const move_iterator<_IteratorR>& __y)
-> decltype(__x.base() - __y.base())
{ return __x.base() - __y.base(); } { return __x.base() - __y.base(); }
template<typename _Iterator> template<typename _Iterator>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment