From: Myun2 Date: Tue, 1 Jun 2010 04:31:11 +0000 (+0900) Subject: iterator_base.hpp: _Is_GetValueRef_Stack が true の場合の operator ->() とか get_value_ptr... X-Git-Tag: 20111130_shapeup_prev~384 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=e43a32c664f3480884054838e0a6bba821923503;p=roast%2Froast.git iterator_base.hpp: _Is_GetValueRef_Stack が true の場合の operator ->() とか get_value_ptr() は無効(void型にする事により)にした。 --- diff --git a/include/roast/container/iterator_base.hpp b/include/roast/container/iterator_base.hpp index 4137b60d..b6a80c5d 100644 --- a/include/roast/container/iterator_base.hpp +++ b/include/roast/container/iterator_base.hpp @@ -25,15 +25,21 @@ namespace roast{ template struct __iterator_option_traits__Is_GetValueRef_Stack { - typedef _ValueType& ValueType; - typedef const _ValueType& CValueType; + typedef const _ValueType& CValueTypeRef; + typedef const _ValueType* CValueTypePtr; + typedef _ValueType& ValueTypeRef; + typedef _ValueType* ValueTypePtr; }; template struct __iterator_option_traits__Is_GetValueRef_Stack <_trait_true, _ValueType> { - typedef _ValueType ValueType; - typedef const _ValueType CValueType; + typedef const _ValueType CValueTypeRef; + typedef _ValueType ValueTypeRef; + typedef const void CValueTypePtr; + typedef void ValueTypePtr; + //typedef const _ValueType* CValueTypePtr; + //typedef _ValueType* ValueTypePtr; }; //////////////////////////////////////////////////////////// @@ -66,16 +72,26 @@ namespace roast{ typedef _IteratorImpl _Base,_Impl,Impl; public: typedef typename _IteratorImpl::ValueType _ValueType,ValueType; - + typedef typename __iterator_option_traits__Is_GetValueRef_Stack< typename _OptionTraits::_Is_GetValueRef_Stack, - _ValueType>::ValueType _ValueTypeRef,ValueTypeRef; - + _ValueType>::CValueTypeRef _CValueTypeRef,CValueTypeRef; + + typedef typename + __iterator_option_traits__Is_GetValueRef_Stack< + typename _OptionTraits::_Is_GetValueRef_Stack, + _ValueType>::CValueTypePtr _CValueTypePtr,CValueTypePtr; + typedef typename __iterator_option_traits__Is_GetValueRef_Stack< typename _OptionTraits::_Is_GetValueRef_Stack, - _ValueType>::CValueType _CValueTypeRef,CValueTypeRef; + _ValueType>::ValueTypeRef _ValueTypeRef,ValueTypeRef; + + typedef typename + __iterator_option_traits__Is_GetValueRef_Stack< + typename _OptionTraits::_Is_GetValueRef_Stack, + _ValueType>::ValueTypePtr _ValueTypePtr,ValueTypePtr; //typedef typename _IteratorImpl::IndexType _IndexType,IndexType; //typedef typename _IteratorImpl::ListType _ListType,ListType; @@ -163,16 +179,16 @@ namespace roast{ ////////////////////////////////////////// // Value - operator const ValueType() const { return get_value_ref(); } + operator const ValueType() const { return get_value_ref(); } CValueTypeRef operator *() const { return get_value_ref(); } - CValueTypeRef operator ->() const { return get_value_ref(); } - ValueType get_value() const { return get_value_ref(); } - const ValueType* get_value_ptr() const { return &(get_value_ref()); } + CValueTypePtr operator ->() const { return &get_value_ref(); } + CValueTypePtr get_value_ptr() const { return &get_value_ref(); } + ValueType get_value() const { return get_value_ref(); } ValueTypeRef operator *() { return get_value_ref(); } - ValueTypeRef operator ->() { return get_value_ref(); } - ValueType* get_value_ptr() { return &(get_value_ref()); } + ValueTypePtr operator ->() { return &get_value_ref(); } + ValueTypePtr get_value_ptr() { return &get_value_ref(); } _iterator operator =(const _iterator& from){ _IteratorImpl::operator =(from);