Changeset 1563


Ignore:
Timestamp:
Oct 10, 2008, 8:59:55 PM (13 years ago)
Author:
Peter
Message:

adding an iterator_traits specialization for when reference_type is const DataWeight? (without &). refs #398

File:
1 edited

Legend:

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

    r1541 r1563  
    255255    */
    256256    weight_reference weight(Iter iter) const { return iter->weight(); }
     257  };
     258
     259
     260  /**
     261     specialization for weighted iterator with reference const DataWeight
     262   */
     263  template <typename Iter>
     264  struct iterator_traits_detail<Iter, const DataWeight> {
     265    /**
     266       \brief data_reference
     267    */
     268    typedef const double data_reference;
     269
     270    /**
     271       \brief weight_reference
     272    */
     273    typedef const double weight_reference;
     274
     275    /**
     276       \return const reference to data of iterator
     277    */
     278    data_reference data(Iter iter) const { return (*iter).data(); }
     279
     280    /**
     281       \return const reference to weight of iterator
     282    */
     283    weight_reference weight(Iter iter) const { return (*iter).weight(); }
    257284  };
    258285
     
    299326
    300327    /**
    301        \return
     328       \return weight
    302329     */
    303330    weight_reference weight(Iter iter) const
Note: See TracChangeset for help on using the changeset viewer.