PrevUpHomeNext

Class template leapyear_filter_functor

fd::leapyear_filter_functor — Functor to iterate by leap years.

Synopsis

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

template<typename date_type> 
class leapyear_filter_functor {
public:
  // types
  typedef typename date_type::duration_type duration_type;
  typedef typename date_type::year_type     year_type;    

  // construct/copy/destruct
  leapyear_filter_functor(int);

  // public member functions
  duration_type get_offset(date_type) const;
  duration_type get_neg_offset(date_type) const;

  // public static functions
  static constexpr bool is_leapyear(year_type);
  static constexpr bool is_leapyear(const date_type &);
};

Description

[Note] Note

Doesn't support an interval factor because I consider iterating by leap years already as a special factor for iterating over years. It's just not possible to have a special factor with year_iterator.

leapyear_filter_functor public construct/copy/destruct

  1. leapyear_filter_functor(int);

leapyear_filter_functor public member functions

  1. duration_type get_offset(date_type current) const;
  2. duration_type get_neg_offset(date_type current) const;

leapyear_filter_functor public static functions

  1. static constexpr bool is_leapyear(year_type y);
  2. static constexpr bool is_leapyear(const date_type & d);

PrevUpHomeNext