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

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class greg_day

boost::gregorian::greg_day — Represent a day of the month (range 1 - 31)


// In header: <boost/date_time/gregorian/greg_day.hpp>

class greg_day : public greg_day_rep {
  // construct/copy/destruct

  // public member functions
  BOOST_CXX14_CONSTEXPR value_type as_number() const;
  BOOST_CXX14_CONSTEXPR operator value_type() const;


This small class allows for simple conversion an integer value into a day of the month for a standard gregorian calendar. The type is automatically range checked so values outside of the range 1-31 will cause a bad_day_of_month exception

greg_day public construct/copy/destruct

  1. greg_day(value_type day_of_month);

greg_day public member functions

  1. BOOST_CXX14_CONSTEXPR value_type as_number() const;
  2. BOOST_CXX14_CONSTEXPR operator value_type() const;