Changeset 1377 for trunk/yat/utility


Ignore:
Timestamp:
Jul 16, 2008, 10:09:06 PM (13 years ago)
Author:
Peter
Message:

allow conversion in DataIterator? and WeightIterator?

Location:
trunk/yat/utility
Files:
2 edited

Legend:

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

    r1376 r1377  
    5656
    5757    /**
     58       \brief Conversion constructor.
     59
     60       Create a DataIterator<Base> from a DataIterator<B2>. Possible
     61       if B2 is convertible to a Base. Constructor allows implicit
     62       conversions such as iterator to const_iterator.
     63     */
     64    template<typename B2>
     65    DataIterator(DataIterator<B2> other,
     66                 typename boost::enable_if_convertible<B2, Base>::type* = 0 )
     67      : DataIterator::iterator_adaptor_(other.base()) {}
     68
     69    /**
    5870       using iterator_traits::data on Base iterator
    5971
  • trunk/yat/utility/WeightIterator.h

    r1376 r1377  
    5454
    5555    /**
     56       \brief Conversion constructor.
     57
     58       Create a WeightIterator<Base> from a
     59       WeightIterator<B2>. Possible if B2 is convertible to a
     60       Base. Constructor allows implicit conversions such as iterator
     61       to const_iterator.
     62     */
     63    template<typename B2>
     64    WeightIterator(WeightIterator<B2> other,
     65                   typename boost::enable_if_convertible<B2, Base>::type* = 0 )
     66      : WeightIterator::iterator_adaptor_(other.base()) {}
     67
     68    /**
    5669       using iterator_traits::data on Base iterator
    5770
Note: See TracChangeset for help on using the changeset viewer.