CLASS TEMPLATE(3)

NAME
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 : private boost::less_than_comparable1< date_duration< duration_rep_traits >, boost::equality_comparable1< date_duration< duration_rep_traits >, boost::addable1< date_duration< duration_rep_traits >, boost::subtractable1< date_duration< duration_rep_traits >, boost::dividable2< date_duration< duration_rep_traits >, int > > > > >
{
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);
    Construct from a day count. .RE

        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);
        Construct from another date_duration (Copy Constructor) .RE

  date_duration public member functions

    1.

    duration_rep get_rep() const;
    returns days_ as it's instantiated type - used for streaming .RE

        2.

        bool is_special() const;

        3.

        duration_rep_type days() const;
        returns days as value, not object. .RE

            4.

            bool operator==(const date_duration & rhs) const;
            Equality. .RE

                5.

                bool operator<(const date_duration & rhs) const;
                Less. .RE

                    6.

                    date_duration & operator-=(const date_duration & rhs);
                    Subtract another duration -- result is signed. .RE

                        7.

                        date_duration & operator+=(const date_duration & rhs);
                        Add a duration -- result is signed. .RE

                            8.

                            date_duration operator-() const;
                            unary- Allows for dd = -date_duration(2); -> dd == -2 .RE

                                9.

                                date_duration & operator/=(int divisor);
                                Division operations on a duration with an integer. .RE

                                    10.

                                    bool is_negative() const;
                                    return sign information .RE

  date_duration public static functions

    1.

    static date_duration unit();
    Returns the smallest duration -- used by to calculate 'end'. .RE