00001 #ifndef INDEXED_H 00002 #define INDEXED_H 00003 00004 template<class T> 00005 class Indexed : public T { 00006 private: 00007 unsigned index_; 00008 public: 00009 Indexed() : T(), index_(0) {} 00010 Indexed(T t, unsigned i) : T(t), index_(i) {} 00011 unsigned index() const {return index_;} 00012 Indexed operator+(const Indexed& rhs) const {return Indexed(this->T::operator+(rhs),0);} 00013 }; 00014 00015 #endif