#define __SFJP_ROAST___container__indexer_iterator_HPP__
#include "roast/container/begin_end_iterator.hpp"
-#include <string.h>
+#include <stdio.h> // for NULL
//#define _ROAST_indexer_iterator_DISABLE_IN_WHILE
namespace roast{
+
+ template <typename _ContainerType>
+ struct _indexer_iterator_ContainerMemberType
+ {
+ typedef _ContainerType& type;
+ };
+ template <typename _ContainerType>
+ struct _indexer_iterator_ContainerMemberType<_ContainerType*>
+ {
+ typedef _ContainerType* type;
+ };
+
////////////////////////////////////////////////
template <typename _ContainerType, typename _ValueType, typename _IndexType = size_t >
public:
typedef _ContainerType ContainerType;
+ typedef typename _indexer_iterator_ContainerMemberType<_ContainerType>::type ContainerMemberType;
typedef _ValueType ValueType;
typedef _IndexType IndexType;
typedef _IndexType IteratorType;
protected:
- _ContainerType m_con;
+ ContainerMemberType m_con;
public:
//////////////////////////////////////////
// Constructors
_indexer_iterator_impl()
: _Base(IndexType(0),IndexType(0)),
- m_pcon(NULL)
+ m_con(NULL)
{}
- _indexer_iterator_impl(ContainerType con_in, const IndexType& length)
+ _indexer_iterator_impl(const ContainerType& con_in, const IndexType& length)
: _Base(IndexType(0),length),
m_con(con_in)
{}
- _indexer_iterator_impl(ContainerType con_in, const IndexType& start, const IndexType& end)
+ _indexer_iterator_impl(const ContainerType& con_in, const IndexType& start, const IndexType& end)
: _Base(start,end),
m_con(con_in)
{}