Boost C++ Libraries

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

Click here to view the latest version of this page.
PrevUpHomeNext

Class template date_duration

boost::date_time::date_duration — Duration type with date level resolution.

Synopsis

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

template<typename duration_rep_traits> 
class date_duration {
public:
  // types
  typedef duration_rep_traits::int_type  duration_rep_type;
  typedef duration_rep_traits::impl_type duration_rep;     

  // construct/copy/destruct
  date_duration(duration_rep);
  date_duration(special_values);
  date_duration(const date_duration< duration_rep_traits > &);

  // public member functions
  duration_rep get_rep() const;
  bool is_special() const;
  duration_rep_type days() const;
  bool operator==(const date_duration &) const;
  bool operator<(const date_duration &) const;
  date_duration & operator-=(const date_duration &) ;
  date_duration & operator+=(const date_duration &) ;
  date_duration operator-() const;
  date_duration & operator/=(int) ;
  bool is_negative() const;

  // public static functions
  static date_duration unit() ;
};

Description

date_duration public construct/copy/destruct

  1. date_duration(duration_rep day_count);
  2. date_duration(special_values sv);

    construct from special_values - only works when instantiated with duration_traits_adapted

  3. date_duration(const date_duration< duration_rep_traits > & other);

date_duration public member functions

  1. duration_rep get_rep() const;
  2. bool is_special() const;
  3. duration_rep_type days() const;
  4. bool operator==(const date_duration & rhs) const;
  5. bool operator<(const date_duration & rhs) const;
  6. date_duration & operator-=(const date_duration & rhs) ;
  7. date_duration & operator+=(const date_duration & rhs) ;
  8. date_duration operator-() const;
  9. date_duration & operator/=(int divisor) ;
  10. bool is_negative() const;

date_duration public static functions

  1. static date_duration unit() ;

PrevUpHomeNext