Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Class template date_itr_base

boost::date_time::date_itr_base — Base date iterator type.


// In header: <boost/date_time/date_iterator.hpp>

template<typename date_type> 
class date_itr_base {
  // types
  typedef date_type::duration_type duration_type;    
  typedef date_type                value_type;       
  typedef std::input_iterator_tag  iterator_category;

  // construct/copy/destruct
  virtual ~date_itr_base();

  // public member functions
  date_itr_base & operator++();
  date_itr_base & operator--();
  virtual duration_type get_offset(const date_type &) const = 0;
  virtual duration_type get_neg_offset(const date_type &) const = 0;
  const date_type & operator*() const;
  const date_type * operator->() const;
  bool operator<(const date_type &) const;
  bool operator<=(const date_type &) const;
  bool operator>(const date_type &) const;
  bool operator>=(const date_type &) const;
  bool operator==(const date_type &) const;
  bool operator!=(const date_type &) const;


This class provides the skeleton for the creation of iterators. New and interesting interators can be created by plugging in a new function that derives the next value from the current state. generation of various types of -based information.

Template Parameters


The date_type is a concrete date_type. The date_type must define a duration_type and a calendar_type.

date_itr_base public construct/copy/destruct

  1. date_itr_base(date_type d);
  2. virtual ~date_itr_base();

date_itr_base public member functions

  1. date_itr_base & operator++();
  2. date_itr_base & operator--();
  3. virtual duration_type get_offset(const date_type & current) const = 0;
  4. virtual duration_type get_neg_offset(const date_type & current) const = 0;
  5. const date_type & operator*() const;
  6. const date_type * operator->() const;
  7. bool operator<(const date_type & d) const;
  8. bool operator<=(const date_type & d) const;
  9. bool operator>(const date_type & d) const;
  10. bool operator>=(const date_type & d) const;
  11. bool operator==(const date_type & d) const;
  12. bool operator!=(const date_type & d) const;