Ignore:
Timestamp:
Feb 14, 2008, 3:26:19 PM (13 years ago)
Author:
Peter
Message:

Closes #247. Removed IteratorWeighted? iterators over weighted container instead can use Iterator with a special Policy.

File:
1 edited

Legend:

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

    r1083 r1088  
    261261    //Iterator& operator=(const Iterator&);
    262262  };
     263
     264  /**
     265     Whether Iterator is weighted is desiced by Policy.
     266   */
     267  template<typename A, typename B, typename C, typename D, typename Policy>
     268  struct weighted_iterator_traits<Iterator<A, B, C, D, Policy> > {
     269    typedef typename Policy::weighted_iterator_type type;
     270  };
     271
     272  template<typename A, typename B, typename C, typename D, typename E>
     273  struct iterator_traits<Iterator<A, B, C, D, E> > {
     274    /**
     275       \return data
     276    */
     277    double data(Iterator<A, B, C, D, E> iter) const
     278    { return iter.data(); }
     279
     280    /**
     281       \return weight
     282    */
     283    double weight(Iterator<A, B, C, D, E> iter) const
     284    { return iter.weight(); }
     285
     286  };
     287
     288
    263289}}} // of namespace utility, yat, and theplu
    264290
Note: See TracChangeset for help on using the changeset viewer.