fd::gregorian::date_iterator_interface — Base class that simplifies writing date iterators (through CRTP on the method-level [explicit object member functions]).
// 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 &&); };
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
public member functionstemplate<typename Self> constexpr Self & operator++(this Self && self);
template<typename Self> constexpr auto operator++(this Self && self, int);
template<typename Self> constexpr Self & operator--(this Self && self);
template<typename Self> constexpr auto operator--(this Self && self, int);
template<typename Self> constexpr date_type operator*(this Self && self);