mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-11 13:33:56 +00:00
GCC2 workarounds; fixed permutation_iterator_example
[SVN r22048]
This commit is contained in:
parent
7f125cacb9
commit
13dcd5590f
@ -44,9 +44,9 @@ class node_iter
|
|||||||
|
|
||||||
|
|
||||||
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
||||||
private: // GCC2 can't even grant that friendship to template member functions
|
private: // GCC2 can't grant friendship to template member functions
|
||||||
# endif
|
|
||||||
friend class boost::iterator_core_access;
|
friend class boost::iterator_core_access;
|
||||||
|
# endif
|
||||||
|
|
||||||
template <class OtherValue>
|
template <class OtherValue>
|
||||||
bool equal(node_iter<OtherValue> const& other) const
|
bool equal(node_iter<OtherValue> const& other) const
|
||||||
@ -54,14 +54,14 @@ class node_iter
|
|||||||
return this->m_node == other.m_node;
|
return this->m_node == other.m_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
void increment() { m_node = m_node->next(); }
|
void increment() { m_node = m_node->next(); }
|
||||||
|
|
||||||
Value& dereference() const { return *m_node; }
|
Value& dereference() const { return *m_node; }
|
||||||
|
|
||||||
# ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
# ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||||
public:
|
public:
|
||||||
# else
|
# else
|
||||||
|
private:
|
||||||
template <class> friend class node_iter;
|
template <class> friend class node_iter;
|
||||||
# endif
|
# endif
|
||||||
Value* m_node;
|
Value* m_node;
|
||||||
|
@ -47,8 +47,10 @@ class node_iter
|
|||||||
)
|
)
|
||||||
: super_t(other.base()) {}
|
: super_t(other.base()) {}
|
||||||
|
|
||||||
private:
|
# if !BOOST_WORKAROUND(__GNUC__, == 2)
|
||||||
|
private: // GCC2 can't grant friendship to template member functions
|
||||||
friend class boost::iterator_core_access;
|
friend class boost::iterator_core_access;
|
||||||
|
# endif
|
||||||
void increment() { this->base_reference() = this->base()->next(); }
|
void increment() { this->base_reference() = this->base()->next(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <deque>
|
||||||
|
#include <algorithm>
|
||||||
#include <boost/iterator/permutation_iterator.hpp>
|
#include <boost/iterator/permutation_iterator.hpp>
|
||||||
#include <boost/cstdlib.hpp>
|
#include <boost/cstdlib.hpp>
|
||||||
|
|
||||||
@ -10,7 +11,7 @@ int main() {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
typedef std::vector< int > element_range_type;
|
typedef std::vector< int > element_range_type;
|
||||||
typedef std::list< int > index_type;
|
typedef std::deque< int > index_type;
|
||||||
|
|
||||||
static const int element_range_size = 10;
|
static const int element_range_size = 10;
|
||||||
static const int index_size = 4;
|
static const int index_size = 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user