Changeset 1531 for trunk


Ignore:
Timestamp:
Sep 24, 2008, 11:47:41 PM (13 years ago)
Author:
Peter
Message:

working on WeightedIterator? refs #368

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/iterator_test.cc

    r1527 r1531  
    412412  utility::WeightedIterator<Iter, Iter> iter(vec.begin(), vec.begin());
    413413
    414   //test_trivial_iterator(iter, suite);
    415 
    416 }
     414  test_input_iterator(iter, suite);
     415
     416}
  • trunk/yat/utility/WeightedIterator.h

    r1527 r1531  
    2323*/
    2424
     25#include <boost/iterator/iterator_facade.hpp>
     26
    2527namespace theplu {
    2628namespace yat {
     
    3234  template<typename DataIterator, typename WeightIterator>
    3335  class WeightedIterator
     36    : public boost::iterator_facade<
     37    WeightedIterator<DataIterator, WeightIterator>,
     38    DataWeight,
     39    std::random_access_iterator_tag,
     40    DataWeight>
     41   
    3442  {
    3543  public:
     
    5866
    5967  private:
     68    friend class boost::iterator_core_access;
     69
    6070    DataIterator d_iter_;
    6171    WeightIterator w_iter_;
     72
     73    DataWeight dereference(void) const
     74    { return DataWeight(*d_iter_, *w_iter_); }
     75
     76    void increment(void) { ++d_iter_; ++w_iter_; }
     77
    6278  };
    6379
Note: See TracChangeset for help on using the changeset viewer.