PrevUpHomeNext

Class date_iterator_interface

fd::gregorian::date_iterator_interface — Base class that simplifies writing date iterators (through CRTP on the method-level [explicit object member functions]).

Synopsis

// In header: <fd/date_iterators.h>


class date_iterator_interface {
public:
  // types
  typedef date                    date_type;       
  typedef date_duration           duration_type;   
  typedef calendar                calendar_type;   
  typedef days                    days_type;       
  typedef std::input_iterator_tag iterator_concept;
  typedef std::ptrdiff_t          difference_type; 
  typedef date_type               value_type;      

  // protected member functions
  date_iterator_interface(date_type);

  // public member functions
  template<typename Self> constexpr Self & operator++(this Self &&);
  template<typename Self> constexpr auto operator++(this Self &&, int);
  template<typename Self> constexpr Self & operator--(this Self &&);
  template<typename Self> constexpr auto operator--(this Self &&, int);
  template<typename Self> constexpr date_type operator*(this Self &&);
};

Description

A date iterator is modeled after a C++ input iterator, however it is also decrementable and copyable. Actually, it could be a bidirectional iterator, but a perfect way to compare date iterators needs to be found.

date_iterator_interface protected member functions

  1. date_iterator_interface(date_type d);

date_iterator_interface public member functions

  1. template<typename Self> constexpr Self & operator++(this Self && self);
  2. template<typename Self> constexpr auto operator++(this Self && self, int);
  3. template<typename Self> constexpr Self & operator--(this Self && self);
  4. template<typename Self> constexpr auto operator--(this Self && self, int);
  5. template<typename Self> constexpr date_type operator*(this Self && self);

PrevUpHomeNext