From 79e9571eff75c06cec568c41dca46d5f9e86f6fd Mon Sep 17 00:00:00 2001 From: Myun2 Date: Thu, 3 Jun 2010 16:08:46 +0900 Subject: [PATCH] =?utf8?q?indexer=5Fiterator.hpp=20=5Findexer=5Fiterator?= =?utf8?q?=5Fimpl:=20=5FContainerType=E3=81=8C=E3=83=9D=E3=82=A4=E3=83=B3?= =?utf8?q?=E3=82=BF=E3=81=A7=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88=E3=81=AF?= =?utf8?q?=E5=8F=82=E7=85=A7=E3=81=AB=E3=81=AA=E3=82=8B=E3=82=88=E3=81=86?= =?utf8?q?=E3=81=AB(=E5=A4=9A=E5=88=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/container/indexer_iterator.hpp | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/roast/include/roast/container/indexer_iterator.hpp b/roast/include/roast/container/indexer_iterator.hpp index f654deb1..12ef9433 100644 --- a/roast/include/roast/container/indexer_iterator.hpp +++ b/roast/include/roast/container/indexer_iterator.hpp @@ -4,11 +4,23 @@ #define __SFJP_ROAST___container__indexer_iterator_HPP__ #include "roast/container/begin_end_iterator.hpp" -#include +#include // for NULL //#define _ROAST_indexer_iterator_DISABLE_IN_WHILE namespace roast{ + + template + struct _indexer_iterator_ContainerMemberType + { + typedef _ContainerType& type; + }; + template + struct _indexer_iterator_ContainerMemberType<_ContainerType*> + { + typedef _ContainerType* type; + }; + //////////////////////////////////////////////// template @@ -20,12 +32,13 @@ namespace roast{ 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: ////////////////////////////////////////// @@ -33,13 +46,13 @@ namespace roast{ // 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) {} -- 2.11.0