Define nat in iterators to allow explicit instantiation of iterators.

This commit is contained in:
Ion Gaztañaga
2019-03-05 13:52:08 +01:00
parent da21340323
commit 8dfaee7434
2 changed files with 17 additions and 6 deletions

View File

@@ -297,12 +297,7 @@ class stable_vector_iterator
>::type pointer;
typedef boost::intrusive::pointer_traits<pointer> ptr_traits;
typedef typename ptr_traits::reference reference;
class nat;
typedef typename dtl::if_c< IsConst
, stable_vector_iterator<Pointer, false>
, nat>::type nonconst_iterator;
private:
typedef typename non_const_ptr_traits::template
rebind_pointer<void>::type void_ptr;
typedef stable_vector_detail::node<Pointer> node_type;
@@ -316,6 +311,16 @@ class stable_vector_iterator
typedef typename non_const_ptr_traits::template
rebind_pointer<node_base_ptr>::type node_base_ptr_ptr;
class nat
{
public:
node_base_ptr node_pointer() const
{ return node_base_ptr(); }
};
typedef typename dtl::if_c< IsConst
, stable_vector_iterator<Pointer, false>
, nat>::type nonconst_iterator;
node_base_ptr m_pn;
public:

View File

@@ -96,7 +96,13 @@ class vec_iterator
#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED
private:
Pointer m_ptr;
class nat;
class nat
{
public:
Pointer get_ptr() const
{ return Pointer(); }
};
typedef typename dtl::if_c< IsConst
, vec_iterator<Pointer, false>
, nat>::type nonconst_iterator;