#include "python.h" namespace python { template SeqBase::const_iterator::~const_iterator () {} template SeqBase::const_iterator::const_iterator () { seq = 0; count = 0; } template SeqBase::const_iterator::const_iterator (const SeqBase* s, int where) :seq(s), count(where) {} template SeqBase::const_iterator::const_iterator(const const_iterator& other) { seq = other.seq; count = other.count; } template bool SeqBase::const_iterator::operator== (const const_iterator& other) { return (count == other.count); } template bool SeqBase::const_iterator::operator!= (const const_iterator& other) { return (count != other.count); } template bool SeqBase::const_iterator::operator< (const const_iterator& other) { return (count < other.count); } template bool SeqBase::const_iterator::operator> (const const_iterator& other) { return (count > other.count); } template bool SeqBase::const_iterator::operator<= (const const_iterator& other) { return (count <= other.count); } template bool SeqBase::const_iterator::operator>= (const const_iterator& other) { return (count >= other.count); } template const T SeqBase::const_iterator::operator*() const { return seq->getItem(count); } template const T SeqBase::const_iterator::operator[] (sequence_index_type i) const { return seq->getItem(count + i); } template typename SeqBase::const_iterator::const_iterator& SeqBase::const_iterator::operator=(const const_iterator& other) { if (this == &other) return *this; seq = other.seq; count = other.count; return *this; } template typename SeqBase::const_iterator::const_iterator SeqBase::const_iterator::operator+(int n) const { return const_iterator(seq, count + n); } template typename SeqBase::const_iterator::const_iterator SeqBase::const_iterator::operator-(int n) const { return const_iterator(seq, count - n); } template typename SeqBase::const_iterator::const_iterator& SeqBase::const_iterator::operator+=(int n) { count = count + n; return *this; } template typename SeqBase::const_iterator::const_iterator& SeqBase::const_iterator::operator-=(int n) { count = count - n; return *this; } template int SeqBase::const_iterator::operator-(const const_iterator& other) const { if (seq != other.seq) throw RuntimeError ("SeqBase::const_iterator::- error"); return count - other.count; } // prefix ++ template typename SeqBase::const_iterator::const_iterator& SeqBase::const_iterator::operator++ () { count++; return *this;} // postfix ++ template typename SeqBase::const_iterator::const_iterator SeqBase::const_iterator::operator++ (int) { return const_iterator(seq, count++);} // prefix -- template typename SeqBase::const_iterator::const_iterator& SeqBase::const_iterator::operator-- () { count--; return *this;} // postfix -- template typename SeqBase::const_iterator::const_iterator SeqBase::const_iterator::operator-- (int) { return const_iterator(seq, count--);} }