Fix G++ 4.4 issue

G++ 4.4 on CentOS6 seems to get confused by direct inheritance
from templates. Worked around by introducing typedef.
This commit is contained in:
Johan Wikman
2017-01-09 13:11:58 +02:00
parent 7c13b56e74
commit 75c257327e

View File

@ -110,18 +110,19 @@ public:
class const_iterator; class const_iterator;
// Buffer type, type of pointer to element and type of reference to element.
typedef iterator_base<GWBUF*, uint8_t*, uint8_t&> iterator_base_typedef;
/** /**
* A forward iterator to Buffer. * A forward iterator to Buffer.
*/ */
class iterator : public iterator_base<GWBUF*, // Buffer type class iterator : public iterator_base_typedef
uint8_t*, // Type of pointer to element
uint8_t&> // Type of reference to element
{ {
friend class const_iterator; friend class const_iterator;
public: public:
explicit iterator(GWBUF* pBuffer = NULL) explicit iterator(GWBUF* pBuffer = NULL)
: iterator_base(pBuffer) : iterator_base_typedef(pBuffer)
{} {}
iterator& operator++() iterator& operator++()
@ -154,20 +155,21 @@ public:
} }
}; };
// Buffer type, type of pointer to element and type of reference to element.
typedef iterator_base<const GWBUF*, const uint8_t*, const uint8_t&> const_iterator_base_typedef;
/** /**
* A const forward iterator to Buffer. * A const forward iterator to Buffer.
*/ */
class const_iterator : public iterator_base<const GWBUF*, // Buffer type class const_iterator : public const_iterator_base_typedef
const uint8_t*, // Type of pointer to element
const uint8_t&> // Type of referece to element
{ {
public: public:
explicit const_iterator(const GWBUF* pBuffer = NULL) explicit const_iterator(const GWBUF* pBuffer = NULL)
: iterator_base(pBuffer) : const_iterator_base_typedef(pBuffer)
{} {}
const_iterator(const Buffer::iterator& rhs) const_iterator(const Buffer::iterator& rhs)
: iterator_base(rhs.m_pBuffer) : const_iterator_base_typedef(rhs.m_pBuffer)
{} {}
const_iterator& operator++() const_iterator& operator++()