Ignore:
Timestamp:
Feb 13, 2008, 1:50:45 PM (14 years ago)
Author:
Peter
Message:

working on #247

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Iterator.h

    r1080 r1082  
    4242  template<typename Container, typename weighted_tag, typename value,
    4343           typename pointer = value*, typename reference = value&,
    44            class Policy = IteratorPolicy<Container, reference> >
     44           class Policy = IteratorPolicy<Container, reference, value> >
    4545  class Iterator
    4646    : public std::iterator<std::random_access_iterator_tag, value, size_t,
     
    5151
    5252  private:
    53     typedef Iterator<Container, weighted_tag, value, pointer, reference> self;
     53    typedef Iterator<Container, weighted_tag, value, pointer, reference,
     54                     Policy> self;
    5455
    5556  public:
     
    6869    Iterator(Container& container, size_t row, size_t column)
    6970      : container_(&container), index_(row*container.columns()+column) {}
     71
     72    /**
     73       \return data
     74    */
     75    typename Policy::data_type data(void) const
     76    { yat_assert<std::out_of_range>(index_<this->size(),
     77                                    "Iterator::data");
     78      return ip_.data(*container_, row(index_), column(index_));
     79    }
     80
     81    /**
     82       \return weight
     83    */
     84    typename Policy::weight_type weight(void) const
     85    { yat_assert<std::out_of_range>(index_<this->size(),
     86                                    "Iterator::weight");
     87      return ip_.weight(*container_, row(index_), column(index_));
     88    }
    7089
    7190    /**
Note: See TracChangeset for help on using the changeset viewer.