|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75063 - trunk/boost/ptr_container/detail
From: nesotto_at_[hidden]
Date: 2011-10-19 11:10:31
Author: nesotto
Date: 2011-10-19 11:10:31 EDT (Wed, 19 Oct 2011)
New Revision: 75063
URL: http://svn.boost.org/trac/boost/changeset/75063
Log:
Ticket #5963
Text files modified:
trunk/boost/ptr_container/detail/void_ptr_iterator.hpp | 52 ++++++++++++++++++++++++++++++++++-----
1 files changed, 45 insertions(+), 7 deletions(-)
Modified: trunk/boost/ptr_container/detail/void_ptr_iterator.hpp
==============================================================================
--- trunk/boost/ptr_container/detail/void_ptr_iterator.hpp (original)
+++ trunk/boost/ptr_container/detail/void_ptr_iterator.hpp 2011-10-19 11:10:31 EDT (Wed, 19 Oct 2011)
@@ -161,8 +161,22 @@
return r;
}
+
+ namespace ptr_container_detail
+ {
+ template<typename T, typename U>
+ struct is_compatible
+ {
+ static const bool value = boost::is_same< typename boost::remove_const<T>::type, typename boost::remove_const<U>::type >::value;
+ };
+ }
+
+
template< class VoidIter, class T, class VoidIterU, class U >
- inline BOOST_DEDUCED_TYPENAME void_ptr_iterator<VoidIter,T>::difference_type
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ BOOST_DEDUCED_TYPENAME void_ptr_iterator<VoidIter,T>::difference_type
+ >::type
operator-( void_ptr_iterator<VoidIter,T> l,
void_ptr_iterator<VoidIterU,U> r )
@@ -173,7 +187,11 @@
template< class VoidIterT, class T, class VoidIterU, class U >
- inline bool operator==( const void_ptr_iterator<VoidIterT,T>& l,
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ bool
+ >::type
+ operator==( const void_ptr_iterator<VoidIterT,T>& l,
const void_ptr_iterator<VoidIterU,U>& r )
{
return l.base() == r.base();
@@ -182,7 +200,11 @@
template< class VoidIterT, class T, class VoidIterU, class U >
- inline bool operator!=( const void_ptr_iterator<VoidIterT,T>& l,
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ bool
+ >::type
+ operator!=( const void_ptr_iterator<VoidIterT,T>& l,
const void_ptr_iterator<VoidIterU,U>& r )
{
return l.base() != r.base();
@@ -191,7 +213,11 @@
template< class VoidIterT, class T, class VoidIterU, class U >
- inline bool operator<( const void_ptr_iterator<VoidIterT,T>& l,
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ bool
+ >::type
+ operator<( const void_ptr_iterator<VoidIterT,T>& l,
const void_ptr_iterator<VoidIterU,U>& r )
{
return l.base() < r.base();
@@ -200,7 +226,11 @@
template< class VoidIterT, class T, class VoidIterU, class U >
- inline bool operator<=( const void_ptr_iterator<VoidIterT,T>& l,
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ bool
+ >::type
+ operator<=( const void_ptr_iterator<VoidIterT,T>& l,
const void_ptr_iterator<VoidIterU,U>& r )
{
return l.base() <= r.base();
@@ -209,7 +239,11 @@
template< class VoidIterT, class T, class VoidIterU, class U >
- inline bool operator>( const void_ptr_iterator<VoidIterT,T>& l,
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ bool
+ >::type
+ operator>( const void_ptr_iterator<VoidIterT,T>& l,
const void_ptr_iterator<VoidIterU,U>& r )
{
return l.base() > r.base();
@@ -218,7 +252,11 @@
template< class VoidIterT, class T, class VoidIterU, class U >
- inline bool operator>=( const void_ptr_iterator<VoidIterT,T>& l,
+ inline BOOST_DEDUCED_TYPENAME boost::enable_if<
+ ptr_container_detail::is_compatible<T, U>,
+ bool
+ >::type
+ operator>=( const void_ptr_iterator<VoidIterT,T>& l,
const void_ptr_iterator<VoidIterU,U>& r )
{
return l.base() >= r.base();
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk