{
typedef _linear_iterator_impl_base<_Iterator> _Base;
public:
- typedef _Iterator _IteratorType;
+ typedef _Iterator IteratorType,_IteratorType;
//typedef T _T, _Ty, _Value, _ValueType, ValueType;
typedef _Iterator ValueType;
protected:
////////////////
template <typename _ContainerType, typename _ValueType>
- _linear_iterator_arithmetic<
- _indexer_iterator_impl<_ContainerType,_ValueType>>
+ typename indexer_iterator<_ContainerType,_ValueType>::type
make_indexer_iterator(_ContainerType con, _ValueType value)
{
return _linear_iterator_arithmetic<
private:
typedef _IteratorImpl _Base,_Impl,Impl;
public:
+ typedef _IteratorImpl __Base__iterator;
+ public:
typedef typename _IteratorImpl::ValueType _ValueType,ValueType;
typedef typename
return m_it;
}
+ /*
///////////////////////////////////////////////////////////////////////
// Arithmetic operators
{
return _linear_iterator_impl_base(m_it + n);
}
+ */
};
/////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////
+
+ template <typename _Impl>
+ class _linear_iterator_arithmetic : public _Impl
+ {
+ private:
+ typedef _Impl _Base;
+ typedef _linear_iterator_arithmetic<_Base> _Self;
+ typedef typename _Base::IteratorType IteratorType;
+ public:
+ ///////////////////////////////////////////////////////////////////////
+
+ // Arithmetic operators
+
+ int operator -(const _Self& target) const
+ {
+ return m_it - target.m_it;
+ }
+ int operator -(const IteratorType& target) const
+ {
+ return m_it - target;
+ }
+ _Self operator -(int n) const
+ {
+ return _Self(m_it - n);
+ }
+ _Self operator --() {
+ _Self old = *this;
+ m_it--;
+ return old;
+ }
+ _Self operator --(int) {
+ m_it--;
+ return *this;
+ }
+
+ _Self operator +(int n) const
+ {
+ return _Self(m_it + n);
+ }
+ };
+
+ /////////////////////////////////////////////////////////
template <typename T>
class linear_iterator_base :
using namespace roast;
+template <typename T>
+class A
+{
+};
+
+template <typename C>
+class B : public A<C>
+{
+
+};
+
void main()
{
+ B<int> aaa;
+
char work[32];
- indexer_iterator<char*, char>::type a = indexer_iterator_impl<char*, char>(work, (size_t)32);
+ //indexer_iterator<char*, char>::type a = _indexer_iterator_impl<char*, char>(work,32);
+ indexer_iterator<char*, char>::type a = make_indexer_iterator<char*, char>(work,32);
do
{
- *a = 0;
+ *a = *(a-1);
}while(a.in_dowhile());
- a = indexer_iterator_impl<char*, char>(work, (size_t)32);
+ a = make_indexer_iterator<char*, char>(work,32);
do
{
printf("%d, ", *a);