From 1b61a1b35cd9535030910f08f0d473bb157319b3 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 10 Nov 2014 13:01:47 +0300 Subject: [PATCH] Fix VC++13 skip-list iterator incompatibility --- cds/container/details/skip_list_base.h | 7 ++++++- cds/intrusive/skip_list_nogc.h | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cds/container/details/skip_list_base.h b/cds/container/details/skip_list_base.h index 75b1e090..e7fd7099 100644 --- a/cds/container/details/skip_list_base.h +++ b/cds/container/details/skip_list_base.h @@ -228,6 +228,11 @@ namespace cds { namespace container { : m_It( it ) {} + intrusive_iterator const& underlying_iterator() const + { + return m_It; + } + public: iterator() : m_It() @@ -263,7 +268,7 @@ namespace cds { namespace container { template bool operator ==(iterator const& i ) const { - return m_It == i.m_It; + return m_It == i.underlying_iterator(); } template bool operator !=(iterator const& i ) const diff --git a/cds/intrusive/skip_list_nogc.h b/cds/intrusive/skip_list_nogc.h index 42594679..43e7cee8 100644 --- a/cds/intrusive/skip_list_nogc.h +++ b/cds/intrusive/skip_list_nogc.h @@ -146,6 +146,11 @@ namespace cds { namespace intrusive { return it; } + node_type * node() const + { + return m_pNode; + } + public: iterator() : m_pNode( nullptr ) @@ -188,7 +193,7 @@ namespace cds { namespace intrusive { template bool operator ==(iterator const& i ) const { - return m_pNode == i.m_pNode; + return m_pNode == i.node(); } template bool operator !=(iterator const& i ) const -- 2.34.1