Changeset 3522


Ignore:
Timestamp:
Oct 10, 2016, 9:32:16 AM (7 years ago)
Author:
Peter
Message:

refs #803. In Histogram no need to require forrward iterator but allow all data iterator as long as they are single_pass_iterator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/Histogram.h

    r2333 r3522  
    3232
    3333#include <boost/concept_check.hpp>
     34#include <boost/iterator/iterator_concepts.hpp>
    3435
    3536#include <iosfwd>
     
    230231     Add a range [first, last) of values to Histogram.
    231232
    232      ForwardIterator should be a \ref concept_data_iterator
     233     Type Requirements:
     234     - \c Iterator models a \ref concept_data_iterator
     235     - \c Iterator models a \single_pass_iterator
    233236
    234237     \relates Histogram
    235238   */
    236   template<typename ForwardIterator>
    237   void add(Histogram& h,
    238            ForwardIterator first, ForwardIterator last)
     239  template<typename Iterator>
     240  void add(Histogram& h, Iterator first, Iterator last)
    239241  {
    240     BOOST_CONCEPT_ASSERT((boost::ForwardIterator<ForwardIterator>));
    241     BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<ForwardIterator>));
    242     utility::iterator_traits<ForwardIterator> traits;
     242    BOOST_CONCEPT_ASSERT((boost_concepts::SinglePassIterator<Iterator>));
     243    BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<Iterator>));
     244    utility::iterator_traits<Iterator> traits;
    243245    while (first!=last) {
    244246      h.add(traits.data(first), traits.weight(first));
     
    249251  /**
    250252     The Histogram output operator
    251      
     253
    252254     \relates Histogram
    253255  */
Note: See TracChangeset for help on using the changeset viewer.