Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84167 - in sandbox/chrono_date: boost/chrono/date boost/chrono/date/detail libs/date/build libs/date/doc libs/date/example libs/date/src libs/date/test libs/date/test/dates/days libs/date/test/dates/ydoy libs/date/test/dates/ymd libs/date/test/wrappers
From: vicente.botet_at_[hidden]
Date: 2013-05-06 07:21:30


Author: viboes
Date: 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
New Revision: 84167
URL: http://svn.boost.org/trac/boost/changeset/84167

Log:
Chrono/Date: move to unchecked defaults.
Added:
   sandbox/chrono_date/libs/date/doc/date.qbk (contents, props changed)
Text files modified:
   sandbox/chrono_date/boost/chrono/date/date_generators.hpp | 24 +-
   sandbox/chrono_date/boost/chrono/date/days_date.hpp | 66 ++++----
   sandbox/chrono_date/boost/chrono/date/detail/bounded.hpp | 24 +-
   sandbox/chrono_date/boost/chrono/date/month.hpp | 57 +++++-
   sandbox/chrono_date/boost/chrono/date/month_nth.hpp | 35 ++--
   sandbox/chrono_date/boost/chrono/date/month_nth_weekday.hpp | 22 +-
   sandbox/chrono_date/boost/chrono/date/no_check.hpp | 9
   sandbox/chrono_date/boost/chrono/date/nth.hpp | 6
   sandbox/chrono_date/boost/chrono/date/nth_week.hpp | 8
   sandbox/chrono_date/boost/chrono/date/nth_weekday.hpp | 24 +-
   sandbox/chrono_date/boost/chrono/date/relative_date.hpp | 60 +++---
   sandbox/chrono_date/boost/chrono/date/tuples.hpp | 56 +++---
   sandbox/chrono_date/boost/chrono/date/weekday.hpp | 24 +-
   sandbox/chrono_date/boost/chrono/date/ydoy_date.hpp | 62 ++++----
   sandbox/chrono_date/boost/chrono/date/year.hpp | 44 ++++-
   sandbox/chrono_date/boost/chrono/date/ymd_date.hpp | 48 +++---
   sandbox/chrono_date/libs/date/build/Jamfile.v2 | 12 +
   sandbox/chrono_date/libs/date/doc/Jamfile.v2 | 303 ++++++++++++++++++++++++++++++++++++---
   sandbox/chrono_date/libs/date/example/hello_world.cpp | 7
   sandbox/chrono_date/libs/date/src/conversions.cpp | 14
   sandbox/chrono_date/libs/date/src/date.cpp | 46 +++---
   sandbox/chrono_date/libs/date/src/days_date.cpp | 30 +-
   sandbox/chrono_date/libs/date/src/rel_date.cpp | 123 ++++++++--------
   sandbox/chrono_date/libs/date/src/vars.cpp | 85 +++++-----
   sandbox/chrono_date/libs/date/src/ydoy_date.cpp | 41 ++--
   sandbox/chrono_date/libs/date/src/ymd_date.cpp | 79 ++++++----
   sandbox/chrono_date/libs/date/test/Jamfile.v2 | 9 +
   sandbox/chrono_date/libs/date/test/dates/days/days_date_pass.cpp | 54 +++---
   sandbox/chrono_date/libs/date/test/dates/days/nth_days_date_pass.cpp | 34 ++--
   sandbox/chrono_date/libs/date/test/dates/ydoy/ydoy_date_pass.cpp | 64 ++++----
   sandbox/chrono_date/libs/date/test/dates/ymd/ymd_date_pass.cpp | 57 ++++---
   sandbox/chrono_date/libs/date/test/wrappers/day_of_year_pass.cpp | 14
   sandbox/chrono_date/libs/date/test/wrappers/day_pass.cpp | 24 +-
   sandbox/chrono_date/libs/date/test/wrappers/month_pass.cpp | 50 +++---
   sandbox/chrono_date/libs/date/test/wrappers/nth_pass.cpp | 10
   sandbox/chrono_date/libs/date/test/wrappers/nth_week_pass.cpp | 10
   sandbox/chrono_date/libs/date/test/wrappers/week_pass.cpp | 10
   sandbox/chrono_date/libs/date/test/wrappers/weekday_pass.cpp | 8
   sandbox/chrono_date/libs/date/test/wrappers/year_pass.cpp | 48 +++---
   39 files changed, 1031 insertions(+), 670 deletions(-)

Modified: sandbox/chrono_date/boost/chrono/date/date_generators.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/date_generators.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/date_generators.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -94,7 +94,7 @@
       Date res;
       if (res.set_if_valid_date(d.get_year(),md.get_month(),md.get_day()) && res > d ) return res;
       if (res.set_if_valid_date(year(d.get_year()+1),md.get_month(),md.get_day()) && res > d ) return res;
- res=Date(d.get_year()+2,md.get_month(),md.get_day(),no_check);
+ res=Date(year(d.get_year()+2),md.get_month(),md.get_day());
       return res;
     }
     template <typename Date>
@@ -104,7 +104,7 @@
       Date res;
       if (res.set_if_valid_date(d.get_year(),md.get_month(),md.get_day()) && res >= d) return res;
       if (res.set_if_valid_date(year(d.get_year()+1),md.get_month(),md.get_day()) && res >= d) return res;
- res=Date(d.get_year()+2,md.get_month(),md.get_day(),no_check);
+ res=Date(year(d.get_year()+2),md.get_month(),md.get_day());
       return res;
     }
 
@@ -116,25 +116,25 @@
       Date res;
       if (d.get_month()==dec)
       { // dec and jan have 31 days
- res = Date(d.get_year(),d.get_month(),n.value(),no_check);
+ res = Date(d.get_year(),d.get_month(),n.value());
         std::cout << __FILE__<<"["<<__LINE__ <<"] "<< res << '\n';
 
         if (res > d) return res;
- return Date(d.get_year(),jan,n.value(),no_check);
+ return Date(d.get_year(),jan,n.value());
       }
 
       if (n.value()>28)
       { // As feb could have 29,30 and 31, we need to validate the two first dates
         if (res.set_if_valid_date(d.get_year(),d.get_month(),day(n.value())) && res > d) return res;
         if (res.set_if_valid_date(d.get_year(),month(d.get_month()+1),day(n.value())) && res > d) return res;
- return Date(d.get_year(),d.get_month()+2,n.value(),no_check) ;
+ return Date(d.get_year(),month(d.get_month()+2),day(n.value())) ;
       }
       // nth <= 28 is always valid, so the next is either in this month or the next one
- res = Date(d.get_year(),d.get_month(),n.value(),no_check);
+ res = Date(d.get_year(),d.get_month(),n.value());
       std::cout << __FILE__<<"["<<__LINE__ <<"] "<< res << '\n';
       if (res > d) return res;
       std::cout << __FILE__<<"["<<__LINE__ <<"] "<< int(d.get_month()+1) << '\n';
- return Date(d.get_year(),d.get_month()+1,n.value(),no_check);
+ return Date(d.get_year(),month(d.get_month()+1),day(n.value()));
     }
     template <typename Date>
     inline Date
@@ -143,21 +143,21 @@
       Date res;
       if (d.get_month()==dec)
       { // dec and jan have 31 days
- res = Date(d.get_year(),d.get_month(),n.value(),no_check);
+ res = Date(d.get_year(),d.get_month(),n.value());
         if (res >= d) return res;
- return Date(d.get_year(),jan,n.value(),no_check);
+ return Date(d.get_year(),jan,n.value());
       }
 
       if (n.value()>28)
       { // As feb could have 29,30 and 31, we need to validate the two first dates
         if (res.set_if_valid_date(d.get_year(),d.get_month(),day(n.value())) && res >= d) return res;
         if (res.set_if_valid_date(d.get_year(),month(d.get_month()+1),day(n.value())) && res >= d) return res;
- return Date(d.get_year(),d.get_month()+2,n.value(),no_check) ;
+ return Date(d.get_year(),d.get_month()+2,n.value()) ;
       }
       // nth <= 28 is always valid, so the next is either in this month or the next one
- res = Date(d.get_year(),d.get_month(),n.value(),no_check);
+ res = Date(d.get_year(),d.get_month(),n.value());
       if (res >= d) return res;
- return Date(d.get_year(),month(d.get_month()+1,no_check),n.value(),no_check);
+ return Date(d.get_year(),month(d.get_month()+1),n.value());
     }
 
 

Modified: sandbox/chrono_date/boost/chrono/date/days_date.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/days_date.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/days_date.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -59,7 +59,7 @@
        * Else constructs a @c days_date for which <c>get_year() == y && get_month() == m && get_day() == d</c>.
        * @Throws bad_date if the specified days_date is invalid.
        */
- days_date(year y, month m, day d);
+ days_date(year y, month m, day d, check_t);
       //days_date(year::rep y, month m, day d);
       //days_date(year y, month::rep m, day d);
       //days_date(year y, month m, day::rep d);
@@ -70,7 +70,7 @@
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- days_date(year::rep y, month::rep m, day::rep d, no_check_t) BOOST_NOEXCEPT;
+ days_date(year y, month m, day d) BOOST_NOEXCEPT;
       /**
        * @Effect Constructs a @c days_date using the @c year, @c month_day stored in the arguments as follows:
        * If the value stored in @c md is outside the range of valid dates for the year @c y,
@@ -80,14 +80,14 @@
        * @Throws @c bad_date if the specified @c days_date is invalid.
        * @Note This constructor can be more efficient as the @c month_day is already valid.
        */
- days_date(year y, month_day md);
+ days_date(year y, month_day md, check_t);
       /**
        * @Effect Constructs a @c days_date using the @c year, @c month_day stored in the arguments as follows:
        * Constructs a @c days_date for which <c>get_year() == y && get_month() == md.get_month() && get_day() == md.get_day()</c>.
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- days_date(year::rep, month_day, no_check_t) BOOST_NOEXCEPT;
+ days_date(year, month_day) BOOST_NOEXCEPT;
 
       /**
        * @Effect Constructs a @c days_date using the @c year, @c day_of_year stored in the arguments as follows:
@@ -97,21 +97,21 @@
        * @Throws @c bad_date if the specified @c days_date is invalid.
        * @Note This constructor can be more efficient as the check is simpler.
        */
- days_date(year y, day_of_year doy);
+ days_date(year y, day_of_year doy, check_t);
       /**
        * @Effect Constructs a days_date using the year, day_of_year stored in the arguments as follows:
        * Constructs a days_date for which days_since_epoch() == y.days_since_epoch()+doy.value()
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- days_date(year::rep y, day_of_year::rep doy, no_check_t) BOOST_NOEXCEPT;
+ days_date(year y, day_of_year doy) BOOST_NOEXCEPT;
 
       /**
        * @Effect Constructs a @c days_date using the @c days given as parameter so that:
        * <c>days_since_epoch() == ds.count()</c>.
        * @Throws @bad_date if the days is not in the range [11322,23947853].
        */
- explicit days_date(days d)
+ explicit days_date(days d, check_t)
       : x_(d.count())
       {
         if (!is_valid())
@@ -127,27 +127,27 @@
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- days_date(days d, no_check_t) BOOST_NOEXCEPT
+ days_date(days d) BOOST_NOEXCEPT
       : x_(d.count())
       {
       }
- /**
- * Unchecked constructor from @c days::rep
- * @Effect Constructs a @c days_date using the @c x days given as parameter so that:
- * <c>days_since_epoch() == x.count()</c>.
- * @Note This function doesn't check the parameters validity.
- * It is up to the user to provide a valid ones.
- */
- days_date(days::rep x, no_check_t) BOOST_NOEXCEPT
- : x_(x)
- {
- }
- /**
- * @Effect Constructs a @c days_date constructor from @c year, @c month, @c day stored in the arguments as follows:
- * Constructs a @c days_date so that <c>get_year() == y && get_month() = m && get_day() == d</c>.
- * @Note This function doesn't check the parameters validity.
- * It is up to the user to provide a valid ones.
- */
+// /**
+// * Unchecked constructor from @c days::rep
+// * @Effect Constructs a @c days_date using the @c x days given as parameter so that:
+// * <c>days_since_epoch() == x.count()</c>.
+// * @Note This function doesn't check the parameters validity.
+// * It is up to the user to provide a valid ones.
+// */
+// days_date(days::rep x, no_check_t) BOOST_NOEXCEPT
+// : x_(x)
+// {
+// }
+// /**
+// * @Effect Constructs a @c days_date constructor from @c year, @c month, @c day stored in the arguments as follows:
+// * Constructs a @c days_date so that <c>get_year() == y && get_month() = m && get_day() == d</c>.
+// * @Note This function doesn't check the parameters validity.
+// * It is up to the user to provide a valid ones.
+// */
 // days_date(days::rep x, year::rep, month::rep, day::rep, bool, no_check_t) BOOST_NOEXCEPT
 // : x_(x)
 // {
@@ -159,7 +159,7 @@
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- days_date(year::rep, month::rep, day::rep, bool, no_check_t) BOOST_NOEXCEPT;
+ days_date(year::rep, month::rep, day::rep, bool) BOOST_NOEXCEPT;
 
       // setters
       /**
@@ -224,25 +224,25 @@
       }
 
       /**
- * Returns: <c>day(d_,no_check)</c>.
+ * Returns: <c>day(d_)</c>.
        */
       day get_day() const BOOST_NOEXCEPT
       {
- return day(day_from_day_number(),no_check);
+ return day(day_from_day_number());
       }
       /**
- * Returns: <c>month(m_,no_check)</c>.
+ * Returns: <c>month(m_)</c>.
        */
       month get_month() const BOOST_NOEXCEPT
       {
- return month(month_from_day_number(),no_check);
+ return month(month_from_day_number());
       }
       /**
- * Returns: <c>year(y_,no_check)</c>.
+ * Returns: <c>year(y_)</c>.
        */
       year get_year() const BOOST_NOEXCEPT
       {
- return year(year_from_day_number(),no_check);
+ return year(year_from_day_number());
       }
       /**
        * Returns: @c true if @c year() is a leap year, and @c false otherwise.
@@ -270,7 +270,7 @@
        */
       weekday get_weekday() const BOOST_NOEXCEPT
       {
- return weekday((x_ + 1) % weekday::size, no_check);
+ return weekday((x_ + 1) % weekday::size);
       }
 
       // Days Based Arithmetic

Modified: sandbox/chrono_date/boost/chrono/date/detail/bounded.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/detail/bounded.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/detail/bounded.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -25,16 +25,15 @@
     /**
      * The class @c bounded is used to specify an opaque wrapper around integral type.
      */
- template <typename Tag, int first_, int last_, typename T=int, typename IT=int>
+ template <typename Tag, int first_, int last_, typename T=int>
     class bounded
     {
     public:
       typedef T rep;
- typedef IT irep;
       BOOST_STATIC_CONSTEXPR std::size_t size=last_-first_+1; // :5 bits
 
     private:
- static BOOST_CONSTEXPR bool is_valid_(irep v) BOOST_NOEXCEPT
+ static BOOST_CONSTEXPR bool is_valid_(int v) BOOST_NOEXCEPT
       {
         return (first_ <= v && v <= last_);
       }
@@ -47,7 +46,7 @@
        */
 
 #ifndef BOOST_NO_CXX11_CONSTEXPR
- BOOST_CONSTEXPR explicit bounded(irep d)
+ BOOST_CONSTEXPR explicit bounded(int d, check_t)
       : value_(
           is_valid_(d)
           ? d
@@ -55,7 +54,7 @@
         )
       {}
 #else
- BOOST_CONSTEXPR explicit bounded(irep d)
+ BOOST_CONSTEXPR explicit bounded(int d, check_t)
       : value_(d)
       {
         if (!is_valid_(d))
@@ -68,9 +67,10 @@
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- BOOST_CONSTEXPR bounded(irep d,no_check_t) BOOST_NOEXCEPT
+ BOOST_CONSTEXPR bounded(int d) BOOST_NOEXCEPT
       : value_(d)
       {}
+
       /**
        * @Return if the stored value is a valid one.
        */
@@ -82,7 +82,7 @@
        * @Requires @c is_valid()
        * @Returns the underlying value of that bounded.
        */
- BOOST_CONSTEXPR operator irep() const BOOST_NOEXCEPT
+ BOOST_CONSTEXPR operator int() const BOOST_NOEXCEPT
       {
         return value_;
       }
@@ -90,7 +90,7 @@
        * @Requires @c is_valid()
        * @Returns: the underlying value of that bounded.
        */
- BOOST_CONSTEXPR irep value() const BOOST_NOEXCEPT
+ BOOST_CONSTEXPR int value() const BOOST_NOEXCEPT
       {
         return value_;
       }
@@ -99,28 +99,28 @@
        */
       static BOOST_CONSTEXPR bounded min BOOST_PREVENT_MACRO_SUBSTITUTION () BOOST_NOEXCEPT
       {
- return bounded(first_,no_check);
+ return bounded(first_);
       }
       /**
        * @Returns: the max valid value for a bounded of a month.
        */
       static BOOST_CONSTEXPR bounded max BOOST_PREVENT_MACRO_SUBSTITUTION () BOOST_NOEXCEPT
       {
- return bounded(last_,no_check);
+ return bounded(last_);
       }
       /**
        * @Returns: the first bounded.
        */
       static BOOST_CONSTEXPR bounded first() BOOST_NOEXCEPT
       {
- return bounded(first_,no_check);
+ return bounded(first_);
       }
       /**
        * @Returns: the first bounded.
        */
       static BOOST_CONSTEXPR bounded last() BOOST_NOEXCEPT
       {
- return bounded(last_,no_check);
+ return bounded(last_);
       }
     private:
       rep value_;

Modified: sandbox/chrono_date/boost/chrono/date/month.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/month.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/month.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -11,6 +11,8 @@
 
 #include <boost/cstdint.hpp>
 #include <boost/chrono/date/detail/bounded.hpp>
+#include <boost/chrono/date/detail/helpers.hpp>
+#include <boost/chrono/date/date_durations.hpp>
 
 
 namespace boost
@@ -25,24 +27,53 @@
     /**
      * The class @c month is used to specify the month of the year when constructing a date. Its range is [1,12].
      */
- typedef bounded<month_tag, 1, 12, int_least8_t> month;
+ class month: public bounded<month_tag, 1, 12, int_least8_t>
+ {
+ typedef bounded<month_tag, 1, 12, int_least8_t> base_type;
+ public:
+ /**
+ * @Effects: Constructs an object of class month by storing m.
+ * @Postconditions: static_cast<int>(*this) == m.
+ */
+ BOOST_CONSTEXPR explicit month(int m) :
+ base_type(m)
+ {
+ }
+
+ /**
+ * @Effects: Constructs an object of class month by storing m.
+ * @Postconditions: static_cast<int>(*this) == m.
+ * @Throws: if m is outside of the supported range, throws an exception of type bad_date.
+ */
+ BOOST_CONSTEXPR month(int m, check_t) BOOST_NOEXCEPT
+ : base_type(m, check)
+ {}
+
+ /**
+ * @Return the number of days of the month depending on the @c is_leap_year parameter.
+ */
+ days days_in(bool is_leap_year) const BOOST_NOEXCEPT
+ {
+ return days(days_in_month(is_leap_year, value()));
+ }
+ };
 
     /**
      * month pseudo-literals.
      */
 #ifndef BOOST_NO_CXX11_CONSTEXPR
- BOOST_CONSTEXPR_OR_CONST month jan(1, no_check);
- BOOST_CONSTEXPR_OR_CONST month feb(2, no_check);
- BOOST_CONSTEXPR_OR_CONST month mar(3, no_check);
- BOOST_CONSTEXPR_OR_CONST month apr(4, no_check);
- BOOST_CONSTEXPR_OR_CONST month may(5, no_check);
- BOOST_CONSTEXPR_OR_CONST month jun(6, no_check);
- BOOST_CONSTEXPR_OR_CONST month jul(7, no_check);
- BOOST_CONSTEXPR_OR_CONST month aug(8, no_check);
- BOOST_CONSTEXPR_OR_CONST month sep(9, no_check);
- BOOST_CONSTEXPR_OR_CONST month oct(10, no_check);
- BOOST_CONSTEXPR_OR_CONST month nov(11, no_check);
- BOOST_CONSTEXPR_OR_CONST month dec(12, no_check);
+ BOOST_CONSTEXPR_OR_CONST month jan(1);
+ BOOST_CONSTEXPR_OR_CONST month feb(2);
+ BOOST_CONSTEXPR_OR_CONST month mar(3);
+ BOOST_CONSTEXPR_OR_CONST month apr(4);
+ BOOST_CONSTEXPR_OR_CONST month may(5);
+ BOOST_CONSTEXPR_OR_CONST month jun(6);
+ BOOST_CONSTEXPR_OR_CONST month jul(7);
+ BOOST_CONSTEXPR_OR_CONST month aug(8);
+ BOOST_CONSTEXPR_OR_CONST month sep(9);
+ BOOST_CONSTEXPR_OR_CONST month oct(10);
+ BOOST_CONSTEXPR_OR_CONST month nov(11);
+ BOOST_CONSTEXPR_OR_CONST month dec(12);
 #else
     extern const month jan;
     extern const month feb;

Modified: sandbox/chrono_date/boost/chrono/date/month_nth.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/month_nth.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/month_nth.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -12,6 +12,7 @@
 #include <boost/cstdint.hpp>
 #include <boost/chrono/config.hpp>
 #include <boost/chrono/date/nth.hpp>
+#include <boost/chrono/date/no_check.hpp>
 #include <boost/chrono/date/exceptions.hpp>
 #include <boost/chrono/date/detail/to_string.hpp>
 #include <boost/chrono/date/detail/helpers.hpp>
@@ -35,11 +36,11 @@
        * @Postconditions: get_month() == m && get_nth() == d && is_valid().
        * @Throws: if d is outside of the valid range of days of month @c m, throws an exception of type bad_date.
        */
- month_nth(month m, nth d)
+ month_nth(month m, nth d, check_t)
       : m_(m),
       d_(d)
       {
- if (!(d_<= days_in_month(1,m_)))
+ if (!(is_valid()))
         {
           throw_exception( bad_date("nth " + boost::chrono::to_string(int(d)) + "is out of range respect to month" + boost::chrono::to_string(m)) );
         }
@@ -50,9 +51,9 @@
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide the valid ones.
        */
- month_nth(month::rep m, nth::rep d, no_check_t) BOOST_NOEXCEPT
- : m_(m, no_check),
- d_(d, no_check)
+ month_nth(month m, nth d) BOOST_NOEXCEPT
+ : m_(m),
+ d_(d)
       {
       }
       /**
@@ -89,27 +90,27 @@
     inline month_nth operator/(month m, last_t)
     BOOST_NOEXCEPT
     {
- return month_nth(m, nth(6,no_check));
+ return month_nth(m, nth(6));
     }
     inline month_nth operator/(month m, _1st_t) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(1,no_check));
+ return month_nth(m, nth(1));
     }
     inline month_nth operator/(month m, _2nd_t) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(2,no_check));
+ return month_nth(m, nth(2));
     }
     inline month_nth operator/(month m, _3rd_t) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(3,no_check));
+ return month_nth(m, nth(3));
     }
     inline month_nth operator/(month m, _4th_t) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(4,no_check));
+ return month_nth(m, nth(4));
     }
     inline month_nth operator/(month m, _5th_t) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(5,no_check));
+ return month_nth(m, nth(5));
     }
     /**
      * @Returns the @c month_nth with the associated parameters.
@@ -121,28 +122,28 @@
   }
     inline month_nth operator/(last_t, month m)
 BOOST_NOEXCEPT {
- return month_nth(m, nth(6,no_check));
+ return month_nth(m, nth(6));
   }
 
     inline month_nth operator/(_1st_t, month m) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(1,no_check));
+ return month_nth(m, nth(1));
     }
     inline month_nth operator/(_2nd_t, month m) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(2,no_check));
+ return month_nth(m, nth(2));
     }
     inline month_nth operator/(_3rd_t, month m) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(3,no_check));
+ return month_nth(m, nth(3));
     }
     inline month_nth operator/(_4th_t, month m) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(4,no_check));
+ return month_nth(m, nth(4));
     }
     inline month_nth operator/(_5th_t, month m) BOOST_NOEXCEPT
     {
- return month_nth(m, nth(5,no_check));
+ return month_nth(m, nth(5));
     }
 
 

Modified: sandbox/chrono_date/boost/chrono/date/month_nth_weekday.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/month_nth_weekday.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/month_nth_weekday.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -30,23 +30,23 @@
       month m_; // :4
       nth_weekday d_; // :6
     public:
- /**
- * @Effects: Constructs an object of class @c month_nth_weekday by storing @c m and @c nwd.
- * @Postconditions: get_month() == m && get_nth_weekday() == nwd && is_valid().
- */
- month_nth_weekday(month m, nth_weekday nwd) BOOST_NOEXCEPT
- : m_(m),
- d_(nwd)
- {
- // There is no bad combination, so no exception is thrown
- }
+// /**
+// * @Effects: Constructs an object of class @c month_nth_weekday by storing @c m and @c nwd.
+// * @Postconditions: get_month() == m && get_nth_weekday() == nwd && is_valid().
+// */
+// month_nth_weekday(month m, nth_weekday nwd, check_t) BOOST_NOEXCEPT
+// : m_(m, check),
+// d_(nwd, check)
+// {
+// // There is no bad combination, so no exception is thrown
+// }
       /**
        * @Effects: Constructs an object of class @c month_nth_weekday by storing @c m and @c nwd.
        * @Postconditions: get_month() == m && get_nth_weekday() == nwd.
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- month_nth_weekday(month::rep m, nth_weekday d, no_check_t) BOOST_NOEXCEPT
+ month_nth_weekday(month::rep m, nth_weekday d) BOOST_NOEXCEPT
       : m_(m),
       d_(d)
       {

Modified: sandbox/chrono_date/boost/chrono/date/no_check.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/no_check.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/no_check.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -14,9 +14,14 @@
   namespace chrono
   {
 
- struct no_check_t
+// struct no_check_t
+// {};
+// BOOST_CONSTEXPR_OR_CONST no_check_t no_check =
+// {};
+
+ struct check_t
     {};
- BOOST_CONSTEXPR_OR_CONST no_check_t no_check =
+ BOOST_CONSTEXPR_OR_CONST check_t check =
     {};
 
 

Modified: sandbox/chrono_date/boost/chrono/date/nth.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/nth.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/nth.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -35,15 +35,15 @@
        * @Effects: Constructs an object of class @c nth by storing @c s.
        * Throws: if @c s is outside of the range [1, 6], throws an exception of type bad_date.
        */
- BOOST_CONSTEXPR nth(irep s) : base_type(s)
+ BOOST_CONSTEXPR nth(int s, check_t) : base_type(s, check)
       {}
       /**
        * @Effects: Constructs an object of class @c nth by storing @c s.
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- BOOST_CONSTEXPR nth(irep s, no_check_t) BOOST_NOEXCEPT
- : base_type(s, no_check)
+ BOOST_CONSTEXPR nth(int s) BOOST_NOEXCEPT
+ : base_type(s)
       {}
 
       BOOST_CONSTEXPR bool is_not_applicable() const BOOST_NOEXCEPT

Modified: sandbox/chrono_date/boost/chrono/date/nth_week.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/nth_week.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/nth_week.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -32,21 +32,21 @@
 
     public:
       BOOST_STATIC_CONSTEXPR rep not_applicable=7;
- nth_week() : base_type(not_applicable) {}
+ BOOST_CONSTEXPR nth_week() : base_type(not_applicable) {}
 
       /**
        * @Effects: Constructs an object of class @c nth_week by storing @c s.
        * Throws: if @c s is outside of the range [1, 6], throws an exception of type bad_date.
        */
- nth_week(irep s) : base_type(s)
+ BOOST_CONSTEXPR nth_week(int s, check_t) : base_type(s, check)
       {}
       /**
        * @Effects: Constructs an object of class @c nth_week by storing @c s.
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- BOOST_CONSTEXPR nth_week(irep s, no_check_t) BOOST_NOEXCEPT
- : base_type(s, no_check)
+ BOOST_CONSTEXPR nth_week(int s) BOOST_NOEXCEPT
+ : base_type(s)
       {}
 
       BOOST_CONSTEXPR bool is_not_applicable() const BOOST_NOEXCEPT

Modified: sandbox/chrono_date/boost/chrono/date/nth_weekday.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/nth_weekday.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/nth_weekday.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -35,10 +35,10 @@
        * @param dow the day of the year
        * @Effects: Constructs a pair of nth-weekday.
        */
- BOOST_CONSTEXPR nth_weekday(nth_week n, weekday dow) BOOST_NOEXCEPT
+ BOOST_CONSTEXPR nth_weekday(nth_week n, weekday dow, check_t) BOOST_NOEXCEPT
       :
- n_(n),
- dow_(dow)
+ n_(n, check),
+ dow_(dow, check)
       {
         // No invalid condition
       }
@@ -50,10 +50,10 @@
        * @Note This function doesn't check the parameters validity.
        * It is up to the user to provide a valid ones.
        */
- BOOST_CONSTEXPR nth_weekday(nth_week::rep n, weekday::rep dow, no_check_t) BOOST_NOEXCEPT
+ BOOST_CONSTEXPR nth_weekday(nth_week n, weekday dow) BOOST_NOEXCEPT
       :
- n_(n, no_check),
- dow_(dow, no_check)
+ n_(n),
+ dow_(dow)
       {
       }
 
@@ -93,27 +93,27 @@
 
     inline BOOST_CONSTEXPR nth_weekday operator*(last_t, weekday wd) BOOST_NOEXCEPT
     {
- return nth_weekday(nth_week(6,no_check), wd);
+ return nth_weekday(nth_week(6), wd);
     }
     inline BOOST_CONSTEXPR nth_weekday operator*(_1st_t, weekday wd) BOOST_NOEXCEPT
     {
- return nth_weekday(nth_week(1,no_check), wd);
+ return nth_weekday(nth_week(1), wd);
     }
     inline BOOST_CONSTEXPR nth_weekday operator*(_2nd_t, weekday wd) BOOST_NOEXCEPT
     {
- return nth_weekday(nth_week(2,no_check), wd);
+ return nth_weekday(nth_week(2), wd);
     }
     inline BOOST_CONSTEXPR nth_weekday operator*(_3rd_t, weekday wd) BOOST_NOEXCEPT
     {
- return nth_weekday(nth_week(3,no_check), wd);
+ return nth_weekday(nth_week(3), wd);
     }
     inline BOOST_CONSTEXPR nth_weekday operator*(_4th_t, weekday wd) BOOST_NOEXCEPT
     {
- return nth_weekday(nth_week(4,no_check), wd);
+ return nth_weekday(nth_week(4), wd);
     }
     inline BOOST_CONSTEXPR nth_weekday operator*(_5th_t, weekday wd) BOOST_NOEXCEPT
     {
- return nth_weekday(nth_week(5,no_check), wd);
+ return nth_weekday(nth_week(5), wd);
     }
     inline nth_weekday operator*(unsigned n, weekday wd)
     {

Modified: sandbox/chrono_date/boost/chrono/date/relative_date.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/relative_date.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/relative_date.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -75,20 +75,20 @@
        * of @c rel_date valid construction when the specific value for that @c days_date is unimportant.
        */
       rel_date() BOOST_NOEXCEPT;
- rel_date(chrono::year, chrono::month, chrono::nth_weekday);
- rel_date(chrono::year::rep, chrono::month::rep, chrono::nth_weekday, no_check_t)BOOST_NOEXCEPT;
- rel_date(chrono::year, chrono::month, chrono::nth);
- rel_date(chrono::year::rep, chrono::month::rep, chrono::nth, no_check_t)BOOST_NOEXCEPT;
+ rel_date(year, month, nth_weekday);
+ rel_date(year, month, nth_weekday, check_t) BOOST_NOEXCEPT;
+ rel_date(year, month, nth);
+ rel_date(year, month, nth, check_t)BOOST_NOEXCEPT;
 #if BOOST_CHRONO_DATE_REL_DATE_IS_A_MODEL_OF_DATE
- rel_date(chrono::year, chrono::month, chrono::day); // TODO
- rel_date(chrono::year::rep, chrono::month::rep, chrono::day::rep, no_check_t)BOOST_NOEXCEPT;// TODO
- rel_date(chrono::year y, chrono::month_day md);// TODO
- rel_date(chrono::year::rep, chrono::month_day, no_check_t) BOOST_NOEXCEPT;// TODO
+ rel_date(year, month, day); // TODO
+ rel_date(year, month, day, check_t)BOOST_NOEXCEPT;// TODO
+ rel_date(year y, month_day md);// TODO
+ rel_date(year, month_day, check_t) BOOST_NOEXCEPT;// TODO
 
- explicit rel_date(chrono::days d);// TODO
+ explicit rel_date(days d);// TODO
 
- rel_date(chrono::year y, chrono::day_of_year doy);// TODO
- rel_date(year::rep y, day_of_year::rep doy, no_check_t) BOOST_NOEXCEPT;// TODO
+ rel_date(year y, day_of_year doy);// TODO
+ rel_date(year y, day_of_year doy, check_t) BOOST_NOEXCEPT;// TODO
 
       bool set_if_valid_date(year y, month m, day d) BOOST_NOEXCEPT;// TODO
       bool set_if_valid_date(year y, day_of_year doy) BOOST_NOEXCEPT;// TODO
@@ -96,9 +96,9 @@
 
       static rel_date today() BOOST_NOEXCEPT;// TODO
 
- explicit rel_date(boost::chrono::system_clock::time_point tp);// TODO
+ explicit rel_date(system_clock::time_point tp);// TODO
       // explicit
- operator boost::chrono::system_clock::time_point () const;// TODO
+ operator system_clock::time_point () const;// TODO
 
 #endif
       // conversions
@@ -113,41 +113,41 @@
       //bool is_valid() const BOOST_NOEXCEPT;
 
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1 || BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
- chrono::day get_day() const BOOST_NOEXCEPT
+ day get_day() const BOOST_NOEXCEPT
       {
         std::cout << "KKKKKKKKKKKKK" << std::endl;
         if (d_!=0)
- return chrono::day(d_,no_check);
+ return day(d_);
         else {
           std::cout << "KKKKKKKKKKKKK" << std::endl;
- return chrono::day(d_,no_check);
+ return day(d_);
         }
 
       }
- chrono::month get_month() const BOOST_NOEXCEPT
+ month get_month() const BOOST_NOEXCEPT
       {
- return chrono::month(m_,no_check);
+ return month(m_);
       }
- chrono::year get_year() const BOOST_NOEXCEPT
+ year get_year() const BOOST_NOEXCEPT
       {
- return chrono::year(y_,no_check);
+ return year(y_);
       }
       bool is_leap_year() const BOOST_NOEXCEPT
       {
         return leap_;
       }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
- chrono::day get_day() const BOOST_NOEXCEPT
+ day get_day() const BOOST_NOEXCEPT
       {
- return chrono::day(day_from_day_number(),no_check);
+ return day(day_from_day_number());
       }
- chrono::month get_month() const BOOST_NOEXCEPT
+ month get_month() const BOOST_NOEXCEPT
       {
- return chrono::month(month_from_day_number(),no_check);
+ return month(month_from_day_number());
       }
- chrono::year get_year() const BOOST_NOEXCEPT
+ year get_year() const BOOST_NOEXCEPT
       {
- return chrono::year(year_from_day_number(),no_check);
+ return year(year_from_day_number());
       }
       bool is_leap_year() const BOOST_NOEXCEPT
       {
@@ -155,14 +155,14 @@
       }
 #endif
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1 || BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
- chrono::weekday get_weekday() const BOOST_NOEXCEPT
+ weekday get_weekday() const BOOST_NOEXCEPT
       {
- return chrono::weekday((x_+1) % weekday::size,no_check);
+ return weekday((x_+1) % weekday::size);
       }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
- chrono::weekday get_weekday() const BOOST_NOEXCEPT
+ weekday get_weekday() const BOOST_NOEXCEPT
       {
- return chrono::weekday((day_number_from_ymd()+1) % weekday::size,no_check);
+ return weekday((day_number_from_ymd()+1) % weekday::size);
       }
 #endif
 

Modified: sandbox/chrono_date/boost/chrono/date/tuples.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/tuples.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/tuples.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -40,9 +40,9 @@
       m_(m)
       {
       }
- year_month(year::rep y, month::rep m, no_check_t) BOOST_NOEXCEPT
- : y_(y, no_check),
- m_(m, no_check)
+ year_month(year::rep y, month::rep m, check_t) BOOST_NOEXCEPT
+ : y_(y, check),
+ m_(m, check)
       {
       }
       /**
@@ -66,7 +66,7 @@
        */
       days days_in() const BOOST_NOEXCEPT
       {
- return y_.days_in(m_);
+ return y_.days_in_month(m_);
       }
     };
 
@@ -94,9 +94,9 @@
       w_(w)
       {
       }
- year_week(year::rep y, week::rep w, no_check_t) BOOST_NOEXCEPT
- : y_(y, no_check),
- w_(w, no_check)
+ year_week(year y, week w, check_t) BOOST_NOEXCEPT
+ : y_(y, check),
+ w_(w, check)
       {
       }
 
@@ -146,9 +146,9 @@
       {
         // check validity of day relative to month.
       }
- month_day(month::rep m, day::rep d, no_check_t)BOOST_NOEXCEPT
- : m_(m,no_check),
- d_(d,no_check)
+ month_day(month::rep m, day::rep d, check_t)BOOST_NOEXCEPT
+ : m_(m,check),
+ d_(d,check)
       {
       }
       /**
@@ -251,9 +251,9 @@
       {
       }
 
- week_weekday(week::rep w, weekday::rep wd, no_check_t)BOOST_NOEXCEPT
- : w_(w, no_check),
- wd_(wd, no_check)
+ week_weekday(week::rep w, weekday::rep wd, check_t)BOOST_NOEXCEPT
+ : w_(w, check),
+ wd_(wd, check)
       {
       }
       week get_week() const BOOST_NOEXCEPT
@@ -295,10 +295,10 @@
       {
       }
 
- year_month_day(year::rep y, month::rep m, day::rep d, no_check_t)BOOST_NOEXCEPT
- : y_(y, no_check),
- m_(m, no_check),
- d_(d, no_check)
+ year_month_day(year::rep y, month::rep m, day::rep d, check_t)BOOST_NOEXCEPT
+ : y_(y, check),
+ m_(m, check),
+ d_(d, check)
       {
       }
       year get_year() const BOOST_NOEXCEPT
@@ -336,10 +336,10 @@
       {
       }
 
- year_month_day_leap(year::rep y, month::rep m, day::rep d, bool leap, no_check_t)BOOST_NOEXCEPT
- : y_(y, no_check),
- m_(m, no_check),
- d_(d, no_check),
+ year_month_day_leap(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
+ : y_(y),
+ m_(m),
+ d_(d),
       leap_(leap)
       {
       }
@@ -376,9 +376,9 @@
       d_(d)
       {
       }
- year_day_of_year(year::rep y, day_of_year::rep d, no_check_t) BOOST_NOEXCEPT
- : y_(y, no_check),
- d_(d, no_check)
+ year_day_of_year(year::rep y, day_of_year::rep d, check_t) BOOST_NOEXCEPT
+ : y_(y, check),
+ d_(d, check)
       {
       }
       year get_year() const BOOST_NOEXCEPT
@@ -411,10 +411,10 @@
       {
       }
 
- year_week_weekday(year::rep y, week::rep w, weekday::rep wd, no_check_t)BOOST_NOEXCEPT
- : y_(y, no_check),
- w_(w, no_check),
- wd_(wd, no_check)
+ year_week_weekday(year::rep y, week::rep w, weekday::rep wd, check_t)BOOST_NOEXCEPT
+ : y_(y, check),
+ w_(w, check),
+ wd_(wd, check)
       {
       }
       year get_year() const BOOST_NOEXCEPT

Modified: sandbox/chrono_date/boost/chrono/date/weekday.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/weekday.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/weekday.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -34,17 +34,17 @@
 
       /**
        * @Effects Constructs an object of class weekday by storing v.
- * @Postconditions static_cast<irep>(*this) == v
+ * @Postconditions static_cast<int>(*this) == v
        * @Throws if v is outside of the range [0, 6], throws an exception of type bad_date.
        */
- BOOST_CONSTEXPR weekday(irep s) : base_type(s)
+ BOOST_CONSTEXPR weekday(int s, check_t) : base_type(s, check)
       {}
       /**
        * @Effects Constructs an object of class weekday by storing v.
- * @Postconditions static_cast<irep>(*this) == v
+ * @Postconditions static_cast<int>(*this) == v
        */
- BOOST_CONSTEXPR weekday(irep s, no_check_t) BOOST_NOEXCEPT
- : base_type(s, no_check)
+ BOOST_CONSTEXPR weekday(int s) BOOST_NOEXCEPT
+ : base_type(s)
       {}
 
       BOOST_CONSTEXPR bool is_not_applicable() const BOOST_NOEXCEPT
@@ -69,13 +69,13 @@
      */
 #ifndef BOOST_NO_CXX11_CONSTEXPR
     BOOST_CONSTEXPR_OR_CONST weekday
- sun(0, no_check)
- , mon(1, no_check)
- , tue(2, no_check)
- , wed(3, no_check)
- , thu(4, no_check)
- , fri(5, no_check)
- , sat(6, no_check)
+ sun(0)
+ , mon(1)
+ , tue(2)
+ , wed(3)
+ , thu(4)
+ , fri(5)
+ , sat(6)
     ;
 #else
     extern const weekday sun;

Modified: sandbox/chrono_date/boost/chrono/date/ydoy_date.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/ydoy_date.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/ydoy_date.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -60,12 +60,12 @@
        * Else constructs a ydoy_date for which get_year() == y, get_month() == m, get_day() == d.
        * @Throws bad_date if the specified ydoy_date is invalid.
        */
- ydoy_date(chrono::year y, chrono::month m, chrono::day d);
+ ydoy_date(year y, month m, day d, check_t);
       /**
        * @Effect Constructs a ydoy_date constructor from year, month, day stored in the arguments as follows:
        * Constructs a ydoy_date so that get_year() == y, get_month() = m=, get_day() == d.
        */
- ydoy_date(year::rep y, month::rep m, day::rep d, no_check_t)
+ ydoy_date(year y, month m, day d)
 BOOST_NOEXCEPT ;
       /**
        * @Effect Constructs a ydoy_date using the year, month_day stored in the arguments as follows:
@@ -76,13 +76,13 @@
        * @Throws bad_date if the specified ydoy_date is invalid.
        * @Note This constructor can be more efficient as the month_day is already valid.
        */
- ydoy_date(chrono::year y, chrono::month_day md);
+ ydoy_date(year y, month_day md, check_t);
       /**
        * @Effect Constructs a ydoy_date using the year, month_day stored in the arguments as follows:
        * Constructs a ydoy_date for which get_year() == y, get_month() == md.get_month(), get_day() == md.get_month().
        * @Note This constructor can be more efficient as the month_day is already valid.
        */
- ydoy_date(chrono::year::rep, chrono::month_day, no_check_t) BOOST_NOEXCEPT;
+ ydoy_date(year, month_day) BOOST_NOEXCEPT;
 
       /**
        * @Effect Constructs a ydoy_date using the year, day_of_year stored in the arguments as follows:
@@ -92,28 +92,28 @@
        * @Throws bad_date if the specified ydoy_date is invalid.
        * @Note This constructor can be more efficient as the check is simple.
        */
- ydoy_date(chrono::year y, chrono::day_of_year doy);
+ ydoy_date(year y, day_of_year doy, check_t);
       /**
        * @Effect Constructs a ydoy_date using the year, day_of_year stored in the arguments as follows:
        * Constructs a ydoy_date for which days_since_epoch() == y.days_since_epoch()+doy.value()
        * @Throws bad_date if the specified ydoy_date is invalid.
        */
- ydoy_date(year::rep y, day_of_year::rep m, no_check_t) BOOST_NOEXCEPT;
+ ydoy_date(year y, day_of_year m) BOOST_NOEXCEPT;
 
       /**
        * @Effect Constructs a ydoy_date using the days given as parameter so that:
        * days_since_epoch() == ds.count()
        */
- explicit ydoy_date(chrono::days);
+ explicit ydoy_date(days, check_t);
       /**
        * Unchecked constructor from days.
        */
- ydoy_date(days::rep m, no_check_t) BOOST_NOEXCEPT;
+ ydoy_date(days m) BOOST_NOEXCEPT;
 
       /**
        * Unchecked constructor from ymd+leap
        */
- ydoy_date(days::rep, year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ ydoy_date(days::rep, year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
       : y_(y),
       doy_(month_day_to_day_of_year(leap,m,d)),
       leap_(leap)
@@ -123,7 +123,7 @@
       /**
        * Unchecked constructor from ymd+leap
        */
- ydoy_date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ ydoy_date(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
       : y_(y),
       doy_(month_day_to_day_of_year(leap,m,d)),
       leap_(leap)
@@ -149,21 +149,21 @@
        * an exception of type bad_date.
        *
        */
- explicit ydoy_date(boost::chrono::system_clock::time_point tp);
+ explicit ydoy_date(system_clock::time_point tp);
       /**
- * @Returns: A chrono::system_clock::time_point which represents the ydoy_date
+ * @Returns: A system_clock::time_point which represents the ydoy_date
        * referred to by *this at 00:00:00 UTC.
        *
        * @Throws: If the conversion to tp overflows the range of
- * boost::chrono::system_clock::time_point, throws an exception of type bad_date.
+ * system_clock::time_point, throws an exception of type bad_date.
        *
        */
       // explicit
- operator boost::chrono::system_clock::time_point () const;
+ operator system_clock::time_point () const;
 
       bool is_valid() const BOOST_NOEXCEPT
       {
- return year(y_,no_check).is_valid() && day_of_year(doy_,no_check).is_valid();
+ return year(y_).is_valid() && day_of_year(doy_).is_valid();
       }
 
       /**
@@ -177,47 +177,47 @@
       ydoy_date(ymd_date dt);
       operator ymd_date() const
       {
- return days_date(y_, doy_, no_check);
+ return days_date(year(y_), day_of_year(doy_));
       }
 
       ydoy_date(days_date dt);
       operator days_date() const
       {
- return days_date(y_, doy_, no_check);
+ return days_date(year(y_), day_of_year(doy_));
       }
 
       /**
- * @Returns: chrono::day(d_,no_check).
+ * @Returns: day(d_).
        */
- chrono::day get_day() const BOOST_NOEXCEPT
+ day get_day() const BOOST_NOEXCEPT
       {
- return chrono::day(day_of_year_day_of_month(leap_,doy_),no_check);
+ return day(day_of_year_day_of_month(leap_,doy_));
       }
       /**
- * @Returns: chrono::month(m_,no_check).
+ * @Returns: month(m_).
        */
- chrono::month get_month() const BOOST_NOEXCEPT
+ month get_month() const BOOST_NOEXCEPT
       {
- return chrono::month(day_of_year_month(leap_,doy_),no_check);
+ return month(day_of_year_month(leap_,doy_));
       }
       /**
- * @Returns: chrono::year(y_,no_check).
+ * @Returns: year(y_).
        */
- chrono::year get_year() const BOOST_NOEXCEPT
+ year get_year() const BOOST_NOEXCEPT
       {
- return chrono::year(y_,no_check);
+ return year(y_);
       }
       month_day get_month_day() const BOOST_NOEXCEPT
       {
- return month_day(day_of_year_month(leap_,doy_), day_of_year_day_of_month(leap_,doy_), no_check);
+ return month_day(month(day_of_year_month(leap_,doy_)), day(day_of_year_day_of_month(leap_,doy_)));
       }
       year_month get_year_month() const BOOST_NOEXCEPT
       {
- return year_month(y_,day_of_year_month(leap_,doy_),no_check);
+ return year_month(year(y_),month(day_of_year_month(leap_,doy_)));
       }
       year_month_day get_year_month_day() const BOOST_NOEXCEPT
       {
- return to_ymd(year_day_of_year(y_,doy_,no_check));
+ return to_ymd(year_day_of_year(year(y_),day_of_year(doy_)));
       }
       /**
        * @Returns: true if year() is a leap year, and otherwise returns false.
@@ -231,9 +231,9 @@
        * @Returns: A weekday constructed with an int corresponding to *this
        * ydoy_date's day of the week (a value in the range of [0 - 6], 0 is Sunday).
        */
- chrono::weekday get_weekday() const BOOST_NOEXCEPT
+ weekday get_weekday() const BOOST_NOEXCEPT
       {
- return chrono::weekday((days_since_epoch()+days(1)).count() % weekday::size,no_check);
+ return weekday((days_since_epoch()+days(1)).count() % weekday::size);
       }
 
       /**

Modified: sandbox/chrono_date/boost/chrono/date/year.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/year.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/year.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -22,7 +22,9 @@
     /**
      * year tag
      */
- struct year_tag {};
+ struct year_tag
+ {
+ };
 
     /**
      * The class year is used to specify the year when constructing a date.
@@ -31,26 +33,31 @@
      *
      * That range shall be at least [year(-32767)/jan/1 thru year(32767)/dec/31]. Its range is [-32768, 32767].
      */
- class year : public bounded<year_tag, -32768, 32767, int_least32_t>
+ class year: public bounded<year_tag, -32768, 32767, int_least32_t>
     {
       typedef bounded<year_tag, -32768, 32767, int_least32_t> base_type;
     public:
       /**
        * @Effects: Constructs an object of class year by storing y.
        * @Postconditions: static_cast<int>(*this) == y.
- * @Throws: if y is outside of the supported range, throws an exception of type bad_date.
        */
- BOOST_CONSTEXPR explicit year(irep v)
- : base_type(v)
- {}
+ BOOST_CONSTEXPR explicit year(int v) :
+ base_type(v),
+ is_leap_(false),
+ is_leap_initialized_(false)
+ {
+ }
 
       /**
        * @Effects: Constructs an object of class year by storing y.
        * @Postconditions: static_cast<int>(*this) == y.
+ * @Throws: if y is outside of the supported range, throws an exception of type bad_date.
        */
- BOOST_CONSTEXPR year(irep y, no_check_t) BOOST_NOEXCEPT
- : base_type(y, no_check)
- {}
+ BOOST_CONSTEXPR year(int y, check_t) BOOST_NOEXCEPT
+ : base_type(y, check),
+ is_leap_(false),
+ is_leap_initialized_(false)
+ {}
 
       /**
        * @Return the number of days of this year.
@@ -63,7 +70,10 @@
       /**
        * @Return the number of days of the month parameter in this year.
        */
- days days_in(month m) const BOOST_NOEXCEPT;
+ days days_in_month(month m) const BOOST_NOEXCEPT
+ {
+ return m.days_in(is_leap());
+ }
 
       /**
        * @Return the number of days since the epoch until the fist day of this year.
@@ -78,14 +88,22 @@
        */
       bool is_leap() const BOOST_NOEXCEPT
       {
- int32_t y = value();
- return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
+ if ( ! is_leap_initialized_)
+ {
+ int32_t y = value();
+ is_leap_ = y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
+ is_leap_initialized_ = true;
+ }
+ return is_leap_;
       }
 
       static BOOST_CONSTEXPR year zero() BOOST_NOEXCEPT
       {
- return year(0, no_check);
+ return year(0);
       }
+ private:
+ mutable bool is_leap_;
+ mutable bool is_leap_initialized_;
     };
 
   } // chrono

Modified: sandbox/chrono_date/boost/chrono/date/ymd_date.hpp
==============================================================================
--- sandbox/chrono_date/boost/chrono/date/ymd_date.hpp (original)
+++ sandbox/chrono_date/boost/chrono/date/ymd_date.hpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -74,12 +74,12 @@
        * Else constructs a @c ymd_date for which <c>get_year() == y && get_month() == m && get_day() == d</c>.
        * @Throws @c bad_date if the specified @c ymd_date is invalid.
        */
- ymd_date(year y, month m, day d);
+ ymd_date(year y, month m, day d, check_t);
       /**
        * @Effect Constructs a @c ymd_date constructor from @c year, @c month, @c day stored in the arguments as follows:
        * Constructs a ymd_date so that <c>get_year() == y && get_month() = m && get_day() == d</c>.
        */
- ymd_date(year::rep y, month::rep m, day::rep d, no_check_t) BOOST_NOEXCEPT;
+ ymd_date(year y, month m, day d) BOOST_NOEXCEPT;
       /**
        * @Effect Constructs a ymd_date using the year, month_day stored in the arguments as follows:
        * If the value stored in md is outside the range of valid dates for this year y,
@@ -89,13 +89,13 @@
        * @Throws bad_date if the specified ymd_date is invalid.
        * @Note This constructor can be more efficient as the month_day is already valid.
        */
- ymd_date(year y, month_day md);
+ ymd_date(year y, month_day md, check_t);
       /**
        * @Effect Constructs a ymd_date using the year, month_day stored in the arguments as follows:
        * Constructs a ymd_date for which get_year() == y, get_month() == md.get_month(), get_day() == md.get_month().
        * @Note This constructor can be more efficient as the month_day is already valid.
        */
- ymd_date(year::rep, month_day, no_check_t) BOOST_NOEXCEPT;
+ ymd_date(year, month_day) BOOST_NOEXCEPT;
 
       /**
        * @Effect Constructs a ymd_date using the year, day_of_year stored in the arguments as follows:
@@ -105,29 +105,29 @@
        * @Throws bad_date if the specified ymd_date is invalid.
        * @Note This constructor can be more efficient as the check is simple.
        */
- ymd_date(year y, day_of_year doy);
+ ymd_date(year y, day_of_year doy, check_t);
       /**
        * @Effect Constructs a ymd_date using the year, day_of_year stored in the arguments as follows:
        * Constructs a ymd_date for which days_since_epoch() == y.days_since_epoch()+doy.value()
        * @Throws bad_date if the specified ymd_date is invalid.
        */
- ymd_date(year::rep y, day_of_year::rep m, no_check_t) BOOST_NOEXCEPT;
+ ymd_date(year y, day_of_year m) BOOST_NOEXCEPT;
 
       /**
        * @Effect Constructs a ymd_date using the days given as parameter so that:
        * days_since_epoch() == ds.count()
        */
- explicit ymd_date(days);
+ explicit ymd_date(days, check_t);
       /**
        * Unchecked constructor from days.
        */
- ymd_date(days::rep m, no_check_t) BOOST_NOEXCEPT;
+ ymd_date(days m) BOOST_NOEXCEPT;
 
 #if BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 1
       /**
        * Unchecked constructor from days+ymd+leap
        */
- ymd_date(days::rep x, year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ ymd_date(days::rep x, year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
       : x_(x),
       y_(y),
       m_(m),
@@ -138,13 +138,13 @@
       /**
        * Unchecked constructor from ymd+leap
        */
- ymd_date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT;
+ ymd_date(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT;
 
 #elif BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 3
       /**
        * Unchecked constructor from days+ymd+leap
        */
- ymd_date(days::rep, year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ ymd_date(days::rep, year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
       :
       y_(y),
       m_(m),
@@ -155,7 +155,7 @@
       /**
        * Unchecked constructor from ymd+leap
        */
- ymd_date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ ymd_date(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
       : y_(y),
       m_(m),
       d_(d),
@@ -241,41 +241,41 @@
       ymd_date(days_date dt);
       operator days_date() const
       {
- return days_date(days_since_epoch().count(), no_check);
+ return days_date(days_since_epoch());
       }
 
       /**
- * Returns: day(d_,no_check).
+ * Returns: day(d_).
        */
       day get_day() const BOOST_NOEXCEPT
       {
- return day(d_,no_check);
+ return day(d_);
       }
       /**
- * Returns: month(m_,no_check).
+ * Returns: month(m_).
        */
       month get_month() const BOOST_NOEXCEPT
       {
- return month(m_,no_check);
+ return month(m_);
       }
       /**
- * Returns: year(y_,no_check).
+ * Returns: year(y_).
        */
       year get_year() const BOOST_NOEXCEPT
       {
- return year(y_,no_check);
+ return year(y_);
       }
       month_day get_month_day() const BOOST_NOEXCEPT
       {
- return month_day(m_, d_, no_check);
+ return month_day(month(m_), day(d_));
       }
       year_month get_year_month() const BOOST_NOEXCEPT
       {
- return year_month(y_,m_,no_check);
+ return year_month(year(y_),month(m_));
       }
       year_month_day get_year_month_day() const BOOST_NOEXCEPT
       {
- return year_month_day(y_,m_,d_, no_check);
+ return year_month_day(year(y_),month(m_),day(d_));
       }
       /**
        * Returns: true if year() is a leap year, and otherwise returns false.
@@ -292,12 +292,12 @@
        */
       weekday get_weekday() const BOOST_NOEXCEPT
       {
- return weekday((x_ + 1) % weekday::size, no_check);
+ return weekday((x_ + 1) % weekday::size);
       }
 #elif BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 3
       weekday get_weekday() const BOOST_NOEXCEPT
       {
- return weekday((day_number_from_ymd()+1) % weekday::size,no_check);
+ return weekday((day_number_from_ymd()+1) % weekday::size);
       }
 #endif
 

Modified: sandbox/chrono_date/libs/date/build/Jamfile.v2
==============================================================================
--- sandbox/chrono_date/libs/date/build/Jamfile.v2 (original)
+++ sandbox/chrono_date/libs/date/build/Jamfile.v2 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -45,18 +45,30 @@
         <toolset>darwin:<cxxflags>-Wextra
         <toolset>darwin:<cxxflags>-pedantic
         <toolset>darwin:<cxxflags>-Wno-long-long
+ <toolset>darwin-4.6.2:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.1:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.2:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.8.0:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.6.2x:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.1x:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.2x:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.8.0x:<cxxflags>-Wno-unused-local-typedefs
+
         #<toolset>pathscale:<cxxflags>-Wextra
         <toolset>pathscale:<cxxflags>-Wno-long-long
         <toolset>pathscale:<cxxflags>-pedantic
+
         <toolset>clang:<cxxflags>-Wextra
         <toolset>clang:<cxxflags>-pedantic
         <toolset>clang:<cxxflags>-Wno-long-long
+
         <toolset>gcc-mingw-4.4.0:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.5.0:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.6.0:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.6.3:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.7.0:<cxxflags>-fdiagnostics-show-option
         <toolset>gcc-mingw-4.8.0:<cxxflags>-fdiagnostics-show-option
+
 # Note: Some of the remarks from the Intel compiler are disabled
 # remark #304: access control not specified ("public" by default)
 # remark #383: value copied to temporary, reference to temporary used

Modified: sandbox/chrono_date/libs/date/doc/Jamfile.v2
==============================================================================
--- sandbox/chrono_date/libs/date/doc/Jamfile.v2 (original)
+++ sandbox/chrono_date/libs/date/doc/Jamfile.v2 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -1,39 +1,277 @@
-# Boost.Chrono library documentation Jamfile ---------------------------------
+# Boost.Chrono.Date library documentation Jamfile ---------------------------------
 #
-# Copyright Vicente J. Botet Escriba 2009. Use, modification and
+# Copyright Vicente J. Botet Escriba 2012. Use, modification and
 # distribution is subject to the Boost Software License, Version
 # 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 # http://www.boost.org/LICENSE_1_0.txt)
 #
 # See http://www.boost.org for updates, documentation, and revision history.
 
-#import doxygen ;
+#import quickbook ;
+path-constant nav_images : html/images/ ; # png and svg images for home, next, note, tip...
+path-constant images_location : html ; # location of SVG and PNG images referenced by Quickbook.
+
+echo "images_location" $(images_location) ;
+echo "nav_images" $(nav_images) ;
+
+import modules ;
+
+if --enable-index in [ modules.peek : ARGV ]
+{
+ ECHO "Building the Chrono/Date docs with automatic index generation enabled." ;
+ using auto-index ;
+ project : requirements
+ # <auto-index>on turns on index (or off).
+ <auto-index>on
+
+ # Choose indexing method (separately for html and pdf):
+ <format>html:<auto-index-internal>on # on (or off) to use internally generated indexes.
+ # <format>html:<xsl:param>generate.index=0 # Don't let the XSL stylesheets generate indexes.
+
+ <format>pdf:<auto-index-internal>off # on (or off) to use internally generated indexes.
+ # <auto-index-type>index # Use <index>...</index> as the XML wrapper.
+
+ <format>pdf:<xsl:param>index.on.type=1 # For the native stylesheets to generate the different indexes.
+ # PDF native index support is probably better for PDFs as then you actually get page numbers.
+
+ <auto-index-script>index.idx # Specifies the name of the script to load.
+ # <auto-index-prefix>../../../ # Path to /date so index.idx !scan-path can use boost/ and libs/doc.
+ <auto-index-prefix>../../..
+
+ <quickbook-define>enable_index
+
+ # <auto-index-verbose>on
+
+ #doxygen common parameters
+ <doxygen:param>"PREDEFINED=\"BOOST_CHRONO_DATE_DOXYGEN_INVOKED=1\" \\
+ \"BOOST_STATIC_CONSTEXPR=static constexpr\" \\
+ \"BOOST_DEDUCED_TYPENAME=typename\" \\
+ \"BOOST_EXPLICIT=explicit\" \\
+ \"BOOST_NOEXCEPT=noexcept\" \\
+ \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
+ \"BOOST_STATIC_CONSTANT(x,y)=static x const y\" \\
+ \"BOOST_STATIC_ASSERT(cnd)=\" \\
+ \"BOOST_CHRONO_DATE_REQUIRES(CND) \" \\
+ \"BOOST_CONSTEXPR_OR_CONST=constexpr\" \\
+ \"BOOST_CONSTEXPR=constexpr\"" \\
+
+
+
+ <doxygen:param>ALIASES=" Effects=\"<p><b>Effects:</b>\" \\
+ Example=\"<p><b>Example:</b>\" \\
+ TParams=\"<p><b>Template Parameters:</b>\" \\
+ Params=\"<p><b>Parameters:</b>\" \\
+ Param{2}=\"<p> - <b><c>\\1</c></b>: \\2.\" \\
+ Returns=\"<p><b>Returns:</b>\" \\
+ Result=\"<p><b>Result:</b>\" \\
+ Throws=\"<p><b>Throws:</b>\" \\
+ Pre=\"<p><b>Requires:</b>\" \\
+ Requires=\"<p><b>Requires:</b>\" \\
+ Post=\"<p><b>Post-conditions:</b>\" \\
+ Condition=\"<p><b>Condition:</b>\" \\
+ Remark=\"<p><b>Remark(s):</b>\" \\
+ Note=\"<p><b>Note(s):</b>\" \\
+ See=\"<p><b>See:</b>\" \\
+ ThreadSafe=\"<p><b>ThreadSafe:</b> Yes.\" \\
+ Basic=\"<p><b>Exception Safety:</b> basic guarantee\" \\
+ Strong=\"<p><b>Exception Safety:</b> strong guarantee\" \\
+ NoThrow=\"<p><b>Exception Safety:</b> no-throw guarantee\" \\
+ RefSect{1}=\"\\xmlonly<link linkend='boost_opaque.\\1'>\\1</link>\\endxmlonly\" \\
+ RefSect2{2}=\"\\xmlonly<link linkend='boost_opaque.\\1'>\\2</link>\\endxmlonly\" \\
+ RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" \\
+ RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
+
+
+ <doxygen:param>SORT_MEMBER_DOCS=NO
+ <doxygen:param>SHOW_USED_FILES=YES
+
+ <doxygen:param>SHOW_INCLUDE_FILES=YES
+ <doxygen:param>WARNINGS=YES # Default NO, but useful to see warnings, especially in a logfile.
+ # It is also wise to to set a warnings logfile like this:
+ <doxygen:param>WARN_LOGFILE=AutoDoxywarnings.log # This may not be empty (usually not a good sign!), depending on options chosen.
+ # Much better to send message to a logfile than the default stderr.
+ # and make sure that there are no Doxygen errors or significant warnings in the log file.
+ <doxygen:param>RECURSIVE=NO # Search recursively down subdirectories.
+ <doxygen:param>EXTRACT_ALL=YES
+ <doxygen:param>ENABLE_PREPROCESSING=YES
+ <doxygen:param>MACRO_EXPANSION=YES
+
+ <doxygen:param>HIDE_UNDOC_MEMBERS=NO
+ <doxygen:param>EXTRACT_PRIVATE=NO
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES
+ #<doxygen:param>EXPAND_STATIC=YES
+ <doxygen:param>SEARCH_INCLUDES=YES
+ <doxygen:param>INCLUDE_PATH=$(BOOST)
+
+ ;
+}
+else
+{
+ ECHO "Building the Chrono/Date docs with automatic index generation disabled. To get an auto-index, try building with --enable-index." ;
+
+ project : requirements
+ #doxygen common parameters
+ <doxygen:param>"PREDEFINED=\"BOOST_CHRONO_DATE_DOXYGEN_INVOKED=1\" \\
+ \"BOOST_STATIC_CONSTEXPR=static constexpr\" \\
+ \"BOOST_DEDUCED_TYPENAME=typename\" \\
+ \"BOOST_EXPLICIT=explicit\" \\
+ \"BOOST_NOEXCEPT=noexcept\" \\
+ \"BOOST_PREVENT_MACRO_SUBSTITUTION=\" \\
+ \"BOOST_STATIC_CONSTANT(x,y)=static x const y\" \\
+ \"BOOST_STATIC_ASSERT(cnd)=\" \\
+ \"BOOST_CHRONO_DATE_REQUIRES(CND) \" \\
+ \"BOOST_CONSTEXPR_OR_CONST=constexpr\" \\
+ \"BOOST_CONSTEXPR=constexpr\""
+
+# \"BOOST_CHRONO_DATE_REQUIRES(CND) , typename enable_if_c< CND >::type\" \\
+
+ <doxygen:param>ALIASES=" Effects=\"<p><b>Effects:</b>\" \\
+ Example=\"<p><b>Example:</b>\" \\
+ TParams=\"<p><b>Template Parameters:</b>\" \\
+ Params=\"<p><b>Parameters:</b>\" \\
+ Param{2}=\"<p> - <b><c>\\1</c></b>: \\2.\" \\
+ Returns=\"<p><b>Returns:</b>\" \\
+ Result=\"<p><b>Result:</b>\" \\
+ Throws=\"<p><b>Throws:</b>\" \\
+ Pre=\"<p><b>Requires:</b>\" \\
+ Requires=\"<p><b>Requires:</b>\" \\
+ Condition=\"<p><b>Condition:</b>\" \\
+ Post=\"<p><b>Post-conditions:</b>\" \\
+ Remark=\"<p><b>Remark(s):</b>\" \\
+ Note=\"<p><b>Note(s):</b>\" \\
+ See=\"<p><b>See:</b>\" \\
+ ThreadSafe=\"<p><b>ThreadSafe:</b> Yes.\" \\
+ Basic=\"<p><b>Exception Safety:</b> basic guarantee\" \\
+ Strong=\"<p><b>Exception Safety:</b> strong guarantee\" \\
+ NoThrow=\"<p><b>Exception Safety:</b> no-throw guarantee\" \\
+ RefSect{1}=\"\\xmlonly<link linkend='boost_opaque.\\1'>\\1</link>\\endxmlonly\" \\
+ RefSect2{2}=\"\\xmlonly<link linkend='boost_opaque.\\1'>\\2</link>\\endxmlonly\" \\
+ RefClass{1}=\"\\xmlonly<computeroutput><classname alt='\\1'>\\1</classname></computeroutput>\\endxmlonly\" \\
+ RefMacro{1}=\"\\xmlonly<computeroutput><macroname alt='\\1'>\\1</macroname></computeroutput>\\endxmlonly\" "
+
+
+ <doxygen:param>SORT_MEMBER_DOCS=NO
+ <doxygen:param>SHOW_USED_FILES=YES
+
+ <doxygen:param>SHOW_INCLUDE_FILES=YES
+ #<doxygen:param>WARNINGS=YES # Default NO, but useful to see warnings, especially in a logfile.
+ # It is also wise to set a warnings logfile like this:
+ #<doxygen:param>WARN_LOGFILE=AutoDoxywarnings.log # This may not be empty (usually not a good sign!), depending on options chosen.
+ # Much better to send message to a logfile than the default stderr.
+ # and make sure that there are no Doxygen errors or significant warnings in the log file.
+ <doxygen:param>RECURSIVE=NO # Search recursively down subdirectories.
+ <doxygen:param>EXTRACT_ALL=YES
+ <doxygen:param>ENABLE_PREPROCESSING=YES
+ <doxygen:param>MACRO_EXPANSION=YES
+
+ <doxygen:param>HIDE_UNDOC_MEMBERS=NO
+ <doxygen:param>EXTRACT_PRIVATE=NO
+ <doxygen:param>EXPAND_ONLY_PREDEF=YES
+ #<doxygen:param>EXPAND_STATIC=YES
+ <doxygen:param>SEARCH_INCLUDES=YES
+ <doxygen:param>INCLUDE_PATH=$(BOOST)
+
+ ;
+}
+
+using doxygen ; # Required if you want to use Doxygen.
 using quickbook ;
 
-#doxygen autodoc
-# :
-# [ glob ../../../boost/chrono/*.hpp ]
-# [ glob ../../../boost/chrono/allocators/*.hpp ]
-# :
-# <doxygen:param>EXTRACT_ALL=NO
-# <doxygen:param>HIDE_UNDOC_MEMBERS=YES
-# <doxygen:param>EXTRACT_PRIVATE=NO
-# <doxygen:param>EXPAND_ONLY_PREDEF=YES
-# <doxygen:param>PREDEFINED=BOOST_INTERPROCESS_DOXYGEN_INVOKED
-# <xsl:param>"boost.doxygen.reftitle=Boost.Chrono Reference"
-# ;
+doxygen wrappers
+ :
+ [ glob ../../../boost/chrono/date/detail/bounded.hpp ]
+ [ glob ../../../boost/chrono/date/day.hpp ]
+ [ glob ../../../boost/chrono/date/day_of_year.hpp ]
+ [ glob ../../../boost/chrono/date/month.hpp ]
+ [ glob ../../../boost/chrono/date/nth.hpp ]
+ [ glob ../../../boost/chrono/date/nth_week.hpp ]
+ [ glob ../../../boost/chrono/date/week.hpp ]
+ [ glob ../../../boost/chrono/date/weekday.hpp ]
+ [ glob ../../../boost/chrono/date/year.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Date Constrained Yypes"
+ ;
+
+doxygen tuples
+ :
+ [ glob ../../../boost/chrono/date/tuples.hpp ]
+ [ glob ../../../boost/chrono/date/month_nth_weekday.hpp ]
+ [ glob ../../../boost/chrono/date/month_nth.hpp ]
+ [ glob ../../../boost/chrono/date/nth_weekday.hpp ]
+ [ glob ../../../boost/chrono/date/nth_weekday.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Tuples"
+ ;
+
+doxygen dates
+ :
+ [ glob ../../../boost/chrono/date/days_date.hpp ]
+ [ glob ../../../boost/chrono/date/ymd_date.hpp ]
+ [ glob ../../../boost/chrono/date/ydoy_date.hpp ]
+ [ glob ../../../boost/chrono/date/relative_date.hpp ]
+ [ glob ../../../boost/chrono/date/date.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Dates"
+ ;
 
-xml chrono : chrono.qbk ;
+
+doxygen durations
+ :
+ [ glob ../../../boost/chrono/date/date_durations.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Durations"
+ ;
+
+doxygen generators
+ :
+ [ glob ../../../boost/chrono/date/date_generators.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Genarators"
+ ;
+
+doxygen io
+ :
+ [ glob ../../../boost/chrono/date/date_io.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=I/O"
+ ;
+
+
+doxygen config
+ :
+ [ glob ../../../boost/chrono/date/config.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Configuration"
+ ;
+
+doxygen exceptions
+ :
+ [ glob ../../../boost/chrono/date/exceptions.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Exceptions"
+ ;
+
+doxygen no_check
+ :
+ [ glob ../../../boost/chrono/date/no_check.hpp ]
+ [ glob ../../../boost/chrono/date/is_date.hpp ]
+ :
+ <xsl:param>"boost.doxygen.reftitle=Validity check"
+ ;
+
+
+
+xml date : date.qbk ;
 
 boostbook standalone
    :
- chrono
+ date
    :
         # HTML options first:
         # Use graphics not text for navigation:
         <xsl:param>navig.graphics=1
         # How far down we chunk nested sections, basically all of them:
- <xsl:param>chunk.section.depth=2
+ <xsl:param>chunk.section.depth=1
         # Don't put the first section on the same page as the TOC:
         <xsl:param>chunk.first.sections=1
         # How far down sections get TOC's
@@ -47,8 +285,8 @@
         # Path for libraries index:
         <xsl:param>boost.libraries=../../../../libs/libraries.htm
         # Use the main Boost stylesheet:
- <xsl:param>html.stylesheet=../../../../doc/src/boostbook.css
-
+ #<xsl:param>html.stylesheet=../../../../doc/src/boostbook.css
+ <xsl:param>html.stylesheet=./boostbook.css
         # PDF Options:
         # TOC Generation: this is needed for FOP-0.9 and later:
         <format>pdf:<xsl:param>fop1.extensions=0
@@ -68,9 +306,28 @@
         # default pnd graphics are awful in PDF form,
         # better use SVG's instead:
         <format>pdf:<xsl:param>admon.graphics.extension=".svg"
- <format>pdf:<xsl:param>admon.graphics.path=$(boost-images)
- <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/chrono/doc/html
+ <format>pdf:<xsl:param>admon.graphics.path=$(boost-images)/
+ <format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/date/doc/html
+
+
+ <dependency>durations
+ <dependency>wrappers
+ <dependency>tuples
+ <dependency>dates
+ <dependency>generators
+ <dependency>io
+ <dependency>config
+ <dependency>exceptions
+ <dependency>no_check
    ;
 
-install pdf-install : standalone : <location>. <install-type>PDF ;
+path-constant boost-root : [ modules.peek : BOOST ] ;
+install css-install : $(boost-root)/doc/src/boostbook.css : <location>html ;
+
+install png-install : [ glob $(boost-root)/doc/src/images/*.png ] : <location>html/images ;
+install svg-install : [ glob $(boost-root)/doc/src/images/*.svg ] : <location>html/images ;
+
+install pdf-install : standalone : <install-type>PDF <location>. <name>date.pdf ;
 
+install date-png-install : [ glob images/*.png ] : <location>html/images ;
+install date-svg-install : [ glob images/*.svg ] : <location>html/images ;

Added: sandbox/chrono_date/libs/date/doc/date.qbk
==============================================================================
--- (empty file)
+++ sandbox/chrono_date/libs/date/doc/date.qbk 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -0,0 +1,924 @@
+[/
+ / Copyright (c) 2012 Vicente J. Botet Escriba
+ /
+ / Distributed under the Boost Software License, Version 1.0. (See accompanying
+ / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ /]
+
+[article Toward Boost.Chrono.Date
+ [quickbook 1.5]
+ [version 0.2.0]
+ [authors [Botet Escriba, Vicente J.]]
+ [copyright 2012-2013 Vicente J. Botet Escriba]
+ [id boost.date]
+ [/dirname date]
+ [/purpose Date facilities]
+ [license
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENSE_1_0.txt or copy at
+ [@http://www.boost.org/LICENSE_1_0.txt])
+ ]
+]
+
+[def __Boost_Date__ *Boost.Chrono.Date*]
+
+[/
+[def __explicit_convert_to [funcref boost::date::explicit_convert_to explicit_convert_to]]
+
+[def __convertible_to [classref boost::date::convertible_to convertible_to]]
+
+[import ../../../boost/chrono/date/xx.hpp]
+]
+
+[/
+[section Preface]
+
+[:[".]]
+[:[*['-- ]]]
+
+[endsect]
+/]
+
+[warning Date is not a part of the Boost libraries.]
+
+[/========================]
+[section Overview]
+[/========================]
+
+[/====================================]
+[heading How to Use This Documentation]
+[/====================================]
+
+This documentation makes use of the following naming and formatting conventions.
+
+* Code is in `fixed width font` and is syntax-highlighted.
+* Replaceable text that you will need to supply is in [~italics].
+* If a name refers to a free function, it is specified like this:
+ `free_function()`; that is, it is in code font and its name is followed by `()` to indicate that it is a free function.
+* If a name refers to a class template, it is specified like this: `class_template<>`; that is, it is in code font and its name is followed by `<>` to indicate that it is a class template.
+* If a name refers to a function-like macro, it is specified like this: `MACRO()`;
+ that is, it is uppercase in code font and its name is followed by `()` to indicate that it is a function-like macro. Object-like macros appear without the trailing `()`.
+* Names that refer to /concepts/ in the generic programming sense are specified in CamelCase.
+
+[note In addition, notes such as this one specify non-essential information that provides additional background or rationale.]
+
+Finally, you can mentally add the following to any code fragments in this document:
+
+ // Include all of the core Date files
+ #include <boost/chrono/date.hpp>
+
+ using namespace boost::chrono;
+ using namespace boost::chrono::date;
+
+[/==================]
+[section Scope]
+[/==================]
+
+This library provides some date utilities which has been strongly influenced by Std Date proposal by Howard Hinnant which was influenced by Boost.DateTime, but is not proposing exactly what is currently Boost.DateTime. What is proposed herein is a relatively small library.
+
+The implementation is currently composed of 3 different performance designs, all conforming to the same Date concept The API proposed herein is correspondingly small, and yet powerful enough to enable the client to express everything needed in this area.
+[endsect]
+
+
+[section Motivation]
+
+[heading Boost.Chrono.Date versus Boost.DateTime]
+
+The boost::date API is considerably larger. Additionally the boost::date API allows for a few situations which can be visually ambiguous. For example, here is an example using boost with the intent of forming January 2, 2011:
+
+ #include "boost/date_time/gregorian/gregorian.hpp"
+ #include <iostream>
+
+ int main()
+ {
+ using namespace boost::gregorian;
+ // I'm from the US and am used to month/day/year
+ std::cout << date(1, 2, 2011) << '\n';
+ }
+
+The above results in a run time error because the boost::date constructor expects the order of arguments to be year, month, day. This proposal allows the entry of day, month and year to vary. Additionally the first two entries must be a type that unambiguously gives the units (day, month or year). For example:
+
+ std::cout << month(1)/day(2)/2011 << '\n'; // 2011-01-02
+
+If you prefer the year/month/day order, that is just as easily accomplished:
+
+ std::cout << year(2011)/month(1)/2 << '\n'; // 2011-01-02
+
+This library is placed in namespace boost::chrono. This is just another time-keeping library, but it counts sunrises instead of seconds. And it interoperates with the existing Chrono library.
+
+[heading Primary Objective]
+
+
+[heading Secondary Objectives]
+
+
+[heading Related Work]
+
+
+[endsect]
+
+
+[/==================]
+[section Description]
+[/==================]
+
+
+[*Boost.Chrono.Date] provides:
+
+* A general purpose date framework.
+
+[endsect]
+
+
+[endsect]
+
+[/==============================]
+[section:users_guide Users' Guide]
+[/==============================]
+
+[/======================================]
+[section:getting_started Getting Started]
+[/======================================]
+
+[/======================================]
+[section:install Installing Date]
+[/======================================]
+
+[/=================================]
+[heading Getting Boost.Date]
+[/=================================]
+
+You can get the last stable release of Boost.Date by downloading [^date.zip] from the
+
+You can also access the latest (unstable?) state from the [@https://svn.boost.org/svn/boost/sandbox/chrono_date Boost Sandbox].
+
+[/=================================]
+[heading Building Boost.Date]
+[/=================================]
+
+Boost.Date is not a header only library and you need to compile it and build the library before use, for example using:
+
+ bjam libs/chrono_date/build
+
+[/=========================]
+[heading Requirements]
+[/=========================]
+
+[*Boost.Date] depends on *Boost.Config*, *Boost.MPL*, *Boost.TypeTraits*, *Boost.Assert*, *Boost.Utility/EnableIf*, *Boost.Chrono*.
+
+[/=========================================================]
+[heading Building an Executable that Uses Boost.Chrono.Date ]
+[/=========================================================]
+
+In addition to link with the __Boost_Date__ library you need also to link with the [*Boost.Chrono] and [*Boost.System] libraries.
+
+[/========================]
+[heading Exceptions safety]
+[/========================]
+
+All functions in the library are exception-neutral and provide strong guarantee of exception safety as long as the underlying parameters provide it.
+
+[/====================]
+[heading Thread safety]
+[/====================]
+
+All functions in the library are thread-unsafe except when noted explicitly.
+
+[/=======================]
+[heading Tested compilers]
+[/=======================]
+
+[*Boost.Date] is known to work on the following platforms/compilers (lack of some C++/C++0X language support disables some functionality). The needed C++/C++0X language support is:
+
+* SFINAE on expressions
+
+Currently, [*Boost.Date] has been tested on the following compilers/platforms using the trunk (Boost 1.50):
+
+Windows with
+
+* MSVC 10.0
+
+MinGW with
+
+* GCC 4.5.0
+* GCC 4.5.0 -std=c++0x
+* GCC 4.5.2
+* GCC 4.5.2 -std=c++0x
+* GCC 4.6.0
+* GCC 4.6.0 -std=c++0x
+* GCC 4.6.3
+* GCC 4.6.3 -std=c++0x
+* GCC 4.7.0
+* GCC 4.7.0 -std=c++0x
+
+[/
+Cygwin 1.7 with
+
+* GCC 4.3.4
+
+Ubuntu 10.10
+
+* GCC 4.4.5
+* GCC 4.4.5 -std=c++0x
+* GCC 4.5.1
+* GCC 4.5.1 -std=c++0x
+* clang 2.8
+]
+
+MacOs X 10.6.8
+
+* GCC 4.1.2
+* clang 2.9
+* clang 2.9 -std=c++0x
+* clang 3.0
+* clang 3.0 -std=c++0x
+* darwin 4.6.2
+* darwin 4.6.2 -std=c++0x
+* darwin 4.7.0
+* darwin 4.7.0 -std=c++0x
+
+
+[note Please let us know how this works on other platforms/compilers.]
+
+[note Please send any questions, comments and bug reports to boost <at> lists <dot> boost <dot> org.]
+
+[endsect]
+
+[/=============================]
+[section Hello World! ]
+[/=============================]
+
+
+Here's a very quick illustration of how the class can be used.
+
+
+ #include <boost/date.hpp>
+
+ using namesapce boost::date;
+ void test()
+ {
+ }
+
+
+[endsect]
+
+[endsect]
+
+[/====================================]
+[section Tutorial]
+[/====================================]
+
+[section Absolute Date Construction]
+
+Significant effort has been put into designing a library that makes it easy to correctly construct a date, and unlikely to construct an invalid or unexpected date.
+
+In all a `chrono::date` can be entered with three variations of the order of years, months and days. The first two units must be specified, and disambiguates which order you are using. Use of explicit units for the third unit is optional. These three orders were chosen out of the six possible orders because these are the only orders that people actually use worldwide.
+
+ int m, d, y;
+ // give values to m, d and y ...
+ date d1 = year(y) / month(m) / day(d); // ymd ok
+ date d2 = month(m) / day(d) / year(y); // mdy ok
+ date d3 = day(d) / month(m) / year(y); // dmy ok
+
+The other three orderings of year, month, and day are rejected at compile time.
+
+ int m, d, y;
+ // give values to m, d and y ...
+ date d1 = year(y) / day(d) / month(m); // error: use of overloaded operator '/' is ambiguous
+ date d2 = month(m) / year(y) / day(d); // error: invalid operands to operator '/'
+ date d3 = day(d) / year(y) / month(m); // error: invalid operands to operator '/'
+
+The rationale for this is that there exists no country on the planet which uses any other ordering. This is in contradiction to [locale.time.get] which specifies the above three orderings plus a ydm ordering. There is no inconsistency in not offering a year/day/month ordering. No current code will be invalidated. This is simply a lack of support for the ydm ordering.
+
+Furthermore, there exists const objects of type month named jan, feb, ... dec. These can be used exactly as month(m) is used:
+
+ date d1 = jan/day(2)/2011; // jan/2/2011
+ date d2 = year(2011)/jan/2; // jan/2/2011
+ date d3 = day(2)/jan/2011; // jan/2/2011
+
+This makes creating date literals very easy, not prone to error due to ordering issues, and unambiguous to read. Also in this proposal it is not possible to create an invalid date. As dates are constructed or modified by date arithmetic, range checking is done, and an exception (bad_date) is thrown if any field of the date goes out of range.
+
+The user can also avoid the validity of the arguments and the date itself when she know them are valid. In order to tel to the library that no check must be done a tag no_check is used
+
+ date d1 = date(year(2011,no_check),jan,day(2,no_check),no_check); // jan/2/2011
+ date d2 = date(2011,1,2,no_check); // jan/2/2011
+
+The preceding examples will construct the date January 2nd 2011 without any check.
+
+
+[endsect]
+
+[section Relative Date Construction]
+
+Additionally there are const objects with the following names that can be used to specify the nth day of the month:
+
+ _1st
+ _2nd
+ _3rd
+ _4th
+ _5th
+ last
+
+Now you can write (for example):
+
+ date d1 = jan/_2nd/2011; // jan/2/2011
+ date d2 = year(2011)/jan/_2nd; // jan/2/2011
+ date d3 = _2nd/jan/2011; // jan/2/2011
+
+Note the constant last. This provides a very easy way to specify the last day of the month:
+
+ date d1 = last/jan/2011; // jan/31/2011
+
+Sometimes you don't know exactly which day of the month you want, but instead know what weekday of the month you want. For example Mother's Day is celebrated on the second Sunday in May in the US:
+
+ date MothersDay = _2nd*sun/may/2011; // may/8/2011
+
+If you ask for a non-existent date (e.g. the fifth Friday of May in 2011) a bad_date exception will be thrown. If what you really want is the fifth Friday in May only if it exists, else the fourth Friday, you can use last.
+
+ date d1 = last*fri/may/2011; // may/27/2011
+
+If you want to find out how many Fridays there are in May 2011, it is easy to code with:
+
+ int num_fri_in_may = (last*fri/may/2011).day() > 28 ? 5 : 4; // 4
+
+If you don't know which day of the week you're looking for until run time, you can use weekday in the exact same way you use the const objects sun through sat:
+
+ int wd = ...
+ date d1 = _1st*weekday(wd)/may/2011;
+
+Creating dates is safe, easy, intuitive, and efficient.
+
+[endsect]
+
+
+[section date Arithmetic]
+
+Date arithmetic is supported for the units of days, months and years. In the chrono calendar, the length of months and years is not a constant number of days. This complicates the meaning of arithmetic with months and years. This library takes a pragmatic approach to this problem which gives clients choices on how they want to perform the arithmetic.
+
+[section Year-oriented Arithmetic]
+
+For every day of the year but one, adding a year to the date has a straight forward meaning: it modifies the year of the date, but not the day of the month or month of the year. For example oct/day(15)/2011 + years(1) == oct/day(15)/2012. But what about Feb. 29?
+
+The boost library addresses this issue by "snapping to the end of the month." That is Feb. 29, 2012 + 1 year is Feb. 28, 2013. And Feb. 28, 2011 + 1 year is Feb. 29, 2012. But consider this example: John's birthday is Feb. 28. And he wants to print out his birthday for the decade. Using boost this looks like:
+
+ // Print Feb. 28 for each year in the decade
+ for (date d(2010, Feb, 28), e(2020, Feb, 28); d <= e; d += years(1))
+ std::cout << d << '\n';
+
+ 2010-Feb-28
+ 2011-Feb-28
+ 2012-Feb-29
+ 2013-Feb-28
+ 2014-Feb-28
+ 2015-Feb-28
+ 2016-Feb-29
+ 2017-Feb-28
+ 2018-Feb-28
+ 2019-Feb-28
+
+Using the boost design, every leap year the output prints out Feb. 29 instead of Feb. 28. But John wasn't born on Feb. 29! That isn't the behavior he wants. He finds this behavior surprising.
+
+This library prints out Feb. 28 for each year using the syntax below.
+
+ // Print Feb. 28 for each year in the decade
+ for (date d = feb/day(28)/2010, e = feb/day(28)/2020; d != e; d += years(1))
+ std::cout << d << '\n';
+
+ 2010-02-28
+ 2011-02-28
+ 2012-02-28
+ 2013-02-28
+ 2014-02-28
+ 2015-02-28
+ 2016-02-28
+ 2017-02-28
+ 2018-02-28
+ 2019-02-28
+
+And if you add 1 year to feb/day(29)/2012, a bad_date exception is thrown because there is no feb/day(29)/2013. You get exactly the same result as if you had attempted to construct feb/day(29)/2013 directly.
+
+But now Sue comes along, and she happens to have been born on Feb. 29. And she doesn't want to have to wait 4 years to celebrate her birthday. She decides that she wants to celebrate her birthday on the last day of Feb. every year. She can print out her birthdays just as easily as John did:
+
+ // Print the last day in Feb. for each year in the decade
+ for (date d = feb/last/2010, e = feb/last/2020; d != e; d += years(1))
+ std::cout << d << '\n';
+
+ 2010-02-28
+ 2011-02-28
+ 2012-02-29
+ 2013-02-28
+ 2014-02-28
+ 2015-02-28
+ 2016-02-29
+ 2017-02-28
+ 2018-02-28
+ 2019-02-28
+
+When year-oriented arithmetic is applied to a date that has been constructed with last, the library knows that although feb/last/2011 == feb/day(28)/2011, feb/last/2011 + years(1) == feb/day(29)/2012. And the result of this computation behaves as if it had been constructed with feb/last/2012, not feb/day(29)/2012. Thus throughout the for-loop above, the variable d always represents the last day of Feb., no matter what the year is.
+
+So this library enables both desired behaviors (do not "snap-to" and "snap-to"), and also delivers results that are not surprising to the casual reader of the code. And the arithmetic is reversible. If you add a year to a date (and this results in a valid date), and then subtract a year from that result, then you always get back your original date. This is not true of the boost date library.
+
+ void test(date d)
+ {
+ // This should never assert!
+ assert(d + years(1) - years(1) == d);
+ }
+
+For example, using boost, test(date(2012, Feb, 28)) asserts. Indeed boost will fail this test for Feb. 28 of every leap year. But using this proposal, the above test never asserts. It will however throw a bad_date for test(feb/day(29)/2012) (because feb/day(29)/2013 doesn't exist). But it passes for test(feb/last/2012)
+
+To complete the birthday example, Sam, like Sue, was born on Feb. 29. But unlike Sue, he wants to always celebrate his birthday on the day after Feb. 28. This is also easy to accomplish:
+
+ // Print the day after Feb. 28 for each year in the decade
+ for (date d = feb/day(28)/2010, e = feb/day(28)/2020; d != e; d += years(1))
+ std::cout << d + days(1) << '\n';
+
+ 2010-03-01
+ 2011-03-01
+ 2012-02-29
+ 2013-03-01
+ 2014-03-01
+ 2015-03-01
+ 2016-02-29
+ 2017-03-01
+ 2018-03-01
+ 2019-03-01
+
+The implementation cost of this behavior is very inexpensive. It need not impact the sizeof(date) at all, no matter what strategy the vendor is using to store the date. The run time cost is minimal, involving simply checking a few bits of the representation to choose the exact arithmetic algorithm. These assertions are backed by an example implementation for each of the three obvious storage strategies:
+
+ Store year, month, day, and a count of days since the epoch. (Storage space is 64 bits)
+ Store year, month, and day. (Storage space is 32 bits)
+ Store a count of days since the epoch. (Storage space is 32 bits)
+
+In each example implementation above, 6 bits of storage are used to store information such as: this date represents the last day of February. These 6 bits do not participate in the date comparison operations. The remaining bits (58 or 26) are more than sufficient to store the indicated data.
+
+Each of the above example implementations support a range of year(numeric_limits<short>::min())/jan/1 through year(numeric_limits<short>::max())/dec/31 inclusive (range governed by representing the year by a short). Thus this is a proleptic Gregorian calendar. The year preceding year 1 is year 0, and year 0 is a leap year. This is consistent with the definition of an expanded calendar given in ISO 8601:2004: Data elements and interchange formats — Information interchange — Representation of dates and times.
+
+[endsect]
+
+[section Month-oriented Arithmetic]
+
+One can add and subtract months to a date with the same ease and semantics as is done with years. For example you can add a month to jul/day(31)/2011 which results in aug/day(31)/2011. But if you add a month to aug/day(31)/2011 a bad_date is thrown since sep/day(31)/2011 does not exist. However you can always add a month to the _1st day of the month, or to any day of the month <= 28, or to the last day of the month. For example:
+
+ // Print last day of every month in 2011
+ for (date d = jan/last/2011, e = dec/last/2011; d <= e; d += months(1))
+ std::cout << d << '\n';
+
+ 2011-01-31
+ 2011-02-28
+ 2011-03-31
+ 2011-04-30
+ 2011-05-31
+ 2011-06-30
+ 2011-07-31
+ 2011-08-31
+ 2011-09-30
+ 2011-10-31
+ 2011-11-30
+ 2011-12-31
+
+ // Print the 28th of every month in 2011
+ for (date d = jan/day(28)/2011, e = dec/day(28)/2011; d <= e; d += months(1))
+ std::cout << d << '\n';
+
+ 2011-01-28
+ 2011-02-28
+ 2011-03-28
+ 2011-04-28
+ 2011-05-28
+ 2011-06-28
+ 2011-07-28
+ 2011-08-28
+ 2011-09-28
+ 2011-10-28
+ 2011-11-28
+ 2011-12-28
+
+It is also easy to print out the 29th of every month. However one needs to explicitly decide what you want to do for months with less than 29 days. One obvious choice is to simply skip such months:
+
+ // Print the 29th of every month in 2011
+ for (date d = last/jan/2011, e = last/dec/2011; d <= e; d += months(1))
+ if (d.day() >= 29)
+ std::cout << d.year()/d.month()/29 << '\n';
+
+ 2011-01-29
+ 2011-03-29
+ 2011-04-29
+ 2011-05-29
+ 2011-06-29
+ 2011-07-29
+ 2011-08-29
+ 2011-09-29
+ 2011-10-29
+ 2011-11-29
+ 2011-12-29
+
+Year and month-oriented arithmetic also respects nth-day-of-the-week dates. For example if you want to print out the 2nd Tuesday of every odd month that is easily done with:
+
+ // Print the 2nd Tuesday of every odd month in 2011
+ for (date d = tue[2]/jan/2011, e = dec/day(31)/2011; d <= e; d += months(2))
+ std::cout << d << '\n';
+
+ 2011-01-11
+ 2011-03-08
+ 2011-05-10
+ 2011-07-12
+ 2011-09-13
+ 2011-11-08
+
+This final example should be emphasized. Imagine you've just met an extended family at a restaurant, one whom you have not met before. They're celebrating. There's children, parents and grandparents present. They enjoy your company so much they invite you back for the same celebration, same place, "next year." You check the current date and it is May 8, 2011.
+
+On what date should you plan to attend? If they were celebrating a birthday, then you should come back on May 8, 2012. But if they were celebrating Mother's Day then you should come back on May 13, 2012 (the second Sunday of May in 2012) — five whole days later!
+
+ Adding a year (or a month) to a date is intrinsically context sensitive.
+
+The expressions d + years(1) and d + months(1) are only unambiguous when you know the context within which d was constructed. This library stores that context as part of d's state.
+
+[endsect]
+
+[section Day-oriented Arithmetic]
+
+Day-oriented arithmetic is intrinsically less complicated than month and year-oriented arithmetic. The chrono calendar is nothing but a count of sunrises, and a distinct name for each sunrise. You can add any number of days to any date and the result is always a valid date (unless one exceeds the valid range for years). For example:
+
+ // Print out every monday between jan/1/2011 and mar/1/2011;
+ for (date d = _1st*mon/jan/2011, e = mar/_1st/2011; d <= e; d += days(7))
+ std::cout << d << '\n';
+
+ 2011-01-03
+ 2011-01-10
+ 2011-01-17
+ 2011-01-24
+ 2011-01-31
+ 2011-02-07
+ 2011-02-14
+ 2011-02-21
+ 2011-02-28
+
+In the above example, the first Monday of the year is found, and then to get each Monday after that, one simply adds 7 days. There is always another Monday coming up!
+
+Additionally, if you subtract two dates, the result is a chrono::duration with the name days.
+
+ // How many days between may/1/2011 and jan/1/2011?
+ int x = (may/_1st/2011 - jan/_1st/2011).count(); // x == 120
+
+Question: So what happens when you subtract a day from aug/last/2011 and then add a day back? The resultant day will be equal to aug/day(31)/2011. But will it still represent the last day of the month as far as month and year arithmetic is concerned?
+
+Answer: No. dates tagged with "last" information become untagged with that information as soon as they have days added to or subtracted from them. So while aug/last/2011 + months(1) is equal to sep/day(30)/2011, aug/last/2011 - days(1) + days(1) + months(1) results in a bad_date exception because sep/day(31)/2011 does not exist. This is the same behavior you would get if you added months(1) to aug/day(31)/2011.
+
+[endsect]
+[endsect]
+[section Date Observers]
+
+Given a date d you can ask for its day(), month() and year(). These each return a day, month and year respectively. Note that these returned types are not the durations days, months and years. Rather they are the unit-specifiers used to specify a day, month and year which you used to construct the date. Each unit-specifier is implicitly convertible to an int. Example uses:
+
+ date dt = aug/day(16)/2011;
+ int d = dt.day(); // d == 16
+ int m = dt.month(); // m == 8
+ int y = dt.year(); // y == 2011
+
+And:
+
+ date dt = aug/day(16)/2011;
+ // ...
+ // Create date with the same month and year but on the 5th
+ date dt2 = dt.year()/dt.month()/5; // aug/5/2011
+
+Note that in the latter example if year() returned a simple int instead of a year then the construction of dt2 would start with an int instead of a year and thus not be a well-formed date.
+
+To get the weekday (day of the week) of a date use the weekday() member function. This returns a weekday type which is implicitly convertible to int. One can use this to print out an int which represents the day of the week:
+
+ date dt = aug/day(16)/2011;
+ // What day of the week is this?
+ int wd = dt.weekday(); // 2 (Tuesday)
+
+Or one can find the first same weekday of the month of the following year:
+
+ date dt = aug/day(16)/2011;
+ // ...
+ // Get the date that is the first occurrence of the same day of the week
+ // in the same month of the next year
+ date dt2 = _1st*dt.weekday()/dt.month()/(dt.year() + 1); // aug/7/2012, first Tuesday of Aug 2012
+
+This syntax has power. There are nearly infinitely many applications for a date class which we can not imagine. This library creates a small, simple, efficient and consistent language of dates and date arithmetic which is widely applicable to all of the date applications which we have yet to imagine. And because the API for this library is small, it is easy to teach, and easy to learn.
+
+[endsect]
+
+[section Finding the next or previous weekday]
+
+
+Sometimes, given a date, one needs to find the previous Monday, or the following Sunday. For example the ISO week-based year starts on the Monday that falls on or before Jan 4 of each year. With this library you can code that date for year y as:
+
+ date ISO_week_start = mon <= jan/day(4)/y;
+
+That is, the expression wd <= x returns the date y such that y is the first date equal to or prior to x such that y.weekday() == wd. There are four such operations summarized here. Let wd be a weekday expression and d be a date expression:
+
+ wd < d Returns the first date prior to d that has wd as its weekday.
+ wd <= d Returns the first date on or prior to d that has wd as its weekday.
+ wd > d Returns the first date after d that has wd as its weekday.
+ wd >= d Returns the first date on or after d that has wd as its weekday.
+
+[endsect]
+[section date I/O]
+
+dates are obviously streamable. The default formatting is consistent with ISO 8601: yyyy-mm-dd, as has been alluded to in previous examples. Additionally there is a datepunct facet and a date_fmt manipulator. These are basically C++ wrappers around C's strftime. And they also serve as wrappers around the non-standard-but-popular strptime for parsing dates from an istream.
+
+To demonstrate the ease with which dates can be formatted, I'm taking a real-world example from my wife: She once set up a recurring meeting for the odd Fridays of every month. That is, they met on the first, third, and if it existed, the fifth Friday of every month. When I asked her why, she said: "Every week was too often, and every other week wasn't often enough." <shrug>
+
+Here is how you print out the odd Fridays of every month in 2011, using date_fmt to format the date however you want:
+
+ std::cout << date_fmt("%a %b %e, %Y");
+ // Print the odd fridays of every month in 2011
+ for (date d = _1st *fri/jan/2011, e = dec/last/2011; d <= e; d += months(1))
+ {
+ std::cout << d << '\n'; // first Friday of the month
+ std::cout << d + days(14) << '\n'; // third Friday of the month
+ date last_fri = last*fri/d.month()/d.year();
+ if (last_fri.day() >= 29)
+ std::cout << last_fri << '\n'; // fifth Friday of the month if it exists
+ }
+
+ Fri Jan 7, 2011
+ Fri Jan 21, 2011
+ Fri Feb 4, 2011
+ Fri Feb 18, 2011
+ Fri Mar 4, 2011
+ Fri Mar 18, 2011
+ Fri Apr 1, 2011
+ Fri Apr 15, 2011
+ Fri Apr 29, 2011
+ Fri May 6, 2011
+ Fri May 20, 2011
+ Fri Jun 3, 2011
+ Fri Jun 17, 2011
+ Fri Jul 1, 2011
+ Fri Jul 15, 2011
+ Fri Jul 29, 2011
+ Fri Aug 5, 2011
+ Fri Aug 19, 2011
+ Fri Sep 2, 2011
+ Fri Sep 16, 2011
+ Fri Sep 30, 2011
+ Fri Oct 7, 2011
+ Fri Oct 21, 2011
+ Fri Nov 4, 2011
+ Fri Nov 18, 2011
+ Fri Dec 2, 2011
+ Fri Dec 16, 2011
+ Fri Dec 30, 2011
+
+[endsect]
+[section Interoperability with other calendar systems]
+
+
+There are other calendar systems besides the chrono (Gregorian) calendar. For example just to name a few:
+
+ Islamic calendar
+ Hebrew calendar
+ Hindu calendar
+ Chinese calendar
+ Buddhist calendar
+ Julian calendar
+
+This paper proposes only the Gregorian calendar because this represents existing practice for C, C++, POSIX, and ISO 8601. However one has to wonder: shouldn't we design a framework which can support any of the world's calendars?
+
+I claim that such a general framework is unnecessary, and we would likely get it wrong. The reason it is unnecessary is that clients can easily write their own calendars which convert to and from the chrono calendar using only the public API proposed herein. Their calendar may or may not use an API similar to the chrono API. Aside from the Julian calendar, the I/O facets time_get, time_put, and datepunct are not reusable by these other calendars. Indeed, there is very little opportunity for code reuse by making a "calendar framework".
+
+To demonstrate, I coded a Julian calendar which converts to and from the chrono calendar (using no knowledge whatsoever of the implementation of chrono). This calendar is not proposed but shown here only for demonstration purposes.
+
+ julian.h
+ julian.cpp
+
+And here is example use showing how the two calendars can be converted to one another:
+
+ #include <iostream>
+ #include "date"
+ #include "julian.h"
+
+ int main()
+ {
+ std::cout << std::chrono::date_fmt("%a %b %e, %Y");
+ std::chrono::date cd = std::chrono::date::today();
+ julian::date jd(cd);
+ std::cout << "Today is:\n"
+ << cd << " in the std::chrono calendar and\n"
+ << jd << " in the Julian calendar\n";
+ jd -= julian::years(1800);
+ cd = std::chrono::date(jd);
+ std::cout << "1800 years ago the two calendars were aligned:\n"
+ << cd << " in the std::chrono calendar and\n"
+ << jd << " in the Julian calendar\n";
+ }
+
+ Today is:
+ Fri May 6, 2011 in the std::chrono calendar and
+ Fri Apr 23, 2011 in the Julian calendar
+ 1800 years ago the two calendars were aligned:
+ Tue Apr 23, 0211 in the std::chrono calendar and
+ Tue Apr 23, 0211 in the Julian calendar
+
+I firmly believe that any other calendar can be converted to and from the chrono calendar using the techniques shown here for the Julian calendar, and that we need to do nothing to enable clients to do so. Furthermore actually providing these other calendars is far outside of our scope.
+
+[endsect]
+
+[endsect]
+
+[/====================================]
+[section Examples]
+[/====================================]
+
+[section A non-trivial example]
+
+There's nothing like real-world use to test an interface. This is when you find out if using a given API is like flying with the wind, or wading through waist-deep water. In this spirit we would like to present two user-written functions drawn from real-world usage. These two functions are not proposed, though they certainly could be.
+
+ std::tuple<int, std::chrono::weekday, std::chrono::year>
+ date_to_week(std::chrono::date d)
+ std::chrono::date
+ week_to_date(int weeknum, std::chrono::weekday wd, std::chrono::year y);
+
+These functions convert a std::chrono::date to and from the ISO 8601 week-based year format. The rules for this format are:
+
+ The week starts with Monday, and ends with Sunday.
+ The first day of the year is the Monday that occurs on or before Jan. 4.
+ A date is specified by the week number [1 - 53], day of the week [Mon - Sun] and year number.
+ The year number is the same as the Gregorian year number for the Thursday that follows the start of the week-based year.
+ This makes it possible for a day in the week-based year to have a different year number than in the Gregorian calendar for that day.
+
+ISO 8601 gives two examples:
+
+ Sunday Jan. 1, 1995 is the Sunday of week 52 of the year 1994. (Week 1 of 1995 starts on Monday Jan. 2, 1995)
+ Tuesday Dec. 31, 1996 is the Tuesday of week 1 of the year 1997. (The first day of the week-based year 1997 begins on Monday Dec. 30, which is the first Monday on or before Jan. 4, 1997, a Saturday)
+
+These rules seem complex. And yet the code using std::chrono::date to convert to and from the week-based year is remarkably compact and self-explanatory. First we present date_to_week, which returns a triple: week number, day of the week, and week-based year number:
+
+ std::tuple<int, std::chrono::weekday, std::chrono::year>
+ date_to_week(std::chrono::date d)
+ {
+ using namespace std::chrono;
+ month_day jan4 = jan/_4th;
+ date start = mon <= jan4/d.year();
+ if (d < start)
+ start = mon <= jan4/(d.year()-1);
+ else
+ {
+ date next_start = mon <= jan4/(start.year()+1);
+ if (d >= next_start)
+ start = next_start;
+ }
+ return std::tuple<int, weekday, year>((d - start).count()/7 + 1,
+ d.weekday(),
+ (thu > start).year());
+ }
+
+The first line of code creates a "shortcut" for Jan. 4. This isn't necessary. It is used here to demonstrate the use of the month_day object. We could just have easily written jan/_4th/d.year() instead of jan4/d.year() (for example). Use of jan4 is purely a stylistic issue and has negligible performance impact.
+
+The start of the ISO year is stored in start and is found by identifying the Monday on or before Jan. 4. If d falls before the start of the year we just computed, then d must be in the previous ISO year, and so start is recomputed. Else we need to make sure that d does not lie beyond the current ISO year. We compute the start of the next ISO year to check for that, and if necessary, set start to the next ISO year.
+
+Now we have the start of the ISO year which contains d. It is now a simple process to compute the week number and year number for d which are returned in a tuple. Care is taken for the fact that weeks are numbered starting from 1, not 0. And the year number is that of the Thursday following the start of the ISO year. The day of the week remains unchanged from d's.
+
+The reverse conversion, week_to_date is even simpler:
+
+ std::chrono::date
+ week_to_date(int weeknum, std::chrono::weekday wd, std::chrono::year y)
+ {
+ using namespace std::chrono;
+ return (mon <= jan/_4th/y) + days((weeknum - 1)*7 + (wd == 0 ? 6 : wd - 1));
+ }
+
+ Compute the start of the week-based year y.
+ Add to the start date 7 days for each full week, taking into account that the week numbers start at 1, not 0.
+ Add to that the number of days wd is past Monday. Note that Sunday is 6 days past Monday, not one day before it.
+
+These functions can now be used as:
+
+ date d = /* ... */
+ int weeknum;
+ weekday wd(0);
+ year y(0);
+ std::tie(weeknum, wd, y) = date_to_week(d);
+
+and
+
+ d = week_to_date(weeknum, wd, y);
+
+Notes:
+
+ This code is readable.
+ The syntax for finding the Monday on or before a previous date is succinct.
+ The syntax for finding the Thursday after a date is succinct. In this example start + days(3) could have been used in place of thu > start. But the ISO rules are worded in terms of Thursday, and this library provides a natural translation from English to C++.
+
+
+ The implicit conversion from the unit specifiers year and weekday to int is helpful,
+intuitive and safe in this example code. These conversions are so natural that they are not even noticed unless
+you're looking for them.
+ The arguments to the functions are type-safe. If the client gets the order of the arguments wrong, a compile-time error will result. This is easily achievable by the author of these functions because the same type-safety exists in the <date> library.
+ The reasons for not proposing these functions include:
+ They are easy to write using the public API of this proposal.
+ The best precise syntax for these functions is unclear: Should date_to_week return a tuple? Should week_to_date take a tuple? Are these the best names for these functions? etc.
+ Should this functionality exist instead as a separate calendar system (like the julian example?)
+
+[endsect]
+[endsect]
+
+
+[/====================================]
+[section:ext_references External Resources]
+[/====================================]
+[variablelist
+[
+ [[@https://svn.boost.org/svn/boost/sandbox/chrono_date/libs/date/doc/date.html [*Dxxxx - chrono::date]]]
+ [Howard Hinnat]
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3344.pdf [*N3344 - Toward a Standard C++ 'Date' Class]]]
+ [Stefano Pacifico, Alisdair Meredith, John Lakos]
+]
+
+]
+
+[endsect]
+
+[endsect]
+[section Reference]
+
+[heading Notation]
+
+In order to simplify the reference documentation, some shortcuts have been used:
+
+* RT stands for the return type of an operation.
+* CT stands for the common_type of the parameter's type of an operation.
+* CT(A,B) stands for common_type<A,B>::type with typename if needed.
+
+[xinclude config.xml]
+[xinclude exceptions.xml]
+[xinclude no_check.xml]
+[xinclude durations.xml]
+[xinclude wrappers.xml]
+[xinclude tuples.xml]
+[xinclude dates.xml]
+[xinclude generators.xml]
+[xinclude io.xml]
+
+[endsect]
+
+
+[/=================]
+[section Appendices]
+[/=================]
+
+[/====================================]
+[section:history Appendix: History]
+[/====================================]
+[section [*Version 0.1.0, June 30, 2012] ]
+
+['Announcement of Dates]
+
+[*Features:]
+
+* generic date numbers.
+
+[endsect]
+[endsect]
+
+
+[/====================================]
+[section:rationale Appendix: Design Rationale]
+[/====================================]
+
+[heading Why]
+
+
+
+[endsect]
+
+[section:implementation Appendix: Implementation Notes]
+
+[heading Why?]
+
+
+[endsect]
+[/====================================]
+[section:acknowledgements Appendix: Acknowledgements]
+[/====================================]
+
+Thanks to
+
+
+[endsect]
+
+[/=====================================]
+[section:todo Appendix : Future plans]
+[/=====================================]
+
+[heading Tasks to do before review]
+
+* Do the the doc.
+
+[heading Tasks to do if the library is accepted]
+
+* Split the tests.
+* Add .
+
+[heading For later releases]
+
+* Analyze
+
+[endsect]
+[endsect]
+

Modified: sandbox/chrono_date/libs/date/example/hello_world.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/example/hello_world.cpp (original)
+++ sandbox/chrono_date/libs/date/example/hello_world.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -23,8 +23,8 @@
     typedef boost::chrono::duration<double,boost::micro> micros;
 
     std::cout << jan/day(2)/2011 << '\n'; // 2011-01-02
- std::cout << month(1,no_check)/day(2)/2011 << '\n'; // 2011-01-02
- std::cout << date(2011, 1, 2, no_check) << '\n'; // 2011-01-02
+ std::cout << month(1)/day(2)/2011 << '\n'; // 2011-01-02
+ std::cout << date(year(2011),jan,day(2)) << '\n'; // 2011-01-02
     std::cout << '\n';
 
     std::cout << jan/day(1)/2011 << '\n'; // 2011-01-02
@@ -69,6 +69,7 @@
     // ...
     // Create date with the same month and year but on the 5th
     date dt2 = dt.get_year()/dt.get_month()/5; // aug/5/2011
+ (void)dt2;
     int d = dt.get_day(); // d == 5
     int m = dt.get_month(); // m == 8
     int y = dt.get_year(); // y == 2011
@@ -240,7 +241,7 @@
     {
       std::cout << __FILE__<<"["<<__LINE__ <<"] "<< "How many days until next 28th?" << '\n';
       // How many days until next 28th?
- days d=(nth(28)>date::today())- date::today();
+ days d=(nth(5)>date::today())- date::today();
       std::cout << d << '\n';
     }
     {

Modified: sandbox/chrono_date/libs/date/src/conversions.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/conversions.cpp (original)
+++ sandbox/chrono_date/libs/date/src/conversions.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -32,7 +32,7 @@
 // const bool leap = is_leap(y);
 // const month::rep m = day_of_year_month(leap,doy);
 // const day::rep d = day_of_year_day_of_month(leap,doy);
-// return year_month_day(y, m, d, no_check);
+// return year_month_day(y, m, d);
 //
 // }
 // year_month_day_leap to_ymd_leap2(days dt) BOOST_NOEXCEPT
@@ -51,7 +51,7 @@
 // const bool leap = is_leap(y);
 // const month::rep m = day_of_year_month(leap,doy);
 // const day::rep d = day_of_year_day_of_month(leap,doy);
-// return year_month_day_leap(y, m, d, leap, no_check);
+// return year_month_day_leap(y, m, d, leap);
 //
 // }
     year_month_day to_ymd(days dt) BOOST_NOEXCEPT
@@ -77,7 +77,7 @@
 // std::cout <<"m " << int(m) << std::endl;
       const day::rep d = day_of_year_day_of_month(leap,doy+1);
 // std::cout <<"d " << int(d) << std::endl;
- return year_month_day(y, m, d, no_check);
+ return year_month_day(year(y), month(m), day(d));
     }
     year_month_day_leap to_ymd_leap(days dt) BOOST_NOEXCEPT
     {
@@ -94,7 +94,7 @@
       const bool leap = is_leap(y);
       const month::rep m = day_of_year_month(leap,doy+1);
       const day::rep d = day_of_year_day_of_month(leap,doy+1);
- return year_month_day_leap(y, m, d, leap, no_check);
+ return year_month_day_leap(y, m, d, leap);
     }
 
     days to_days(year_month_day dt) BOOST_NOEXCEPT
@@ -115,7 +115,7 @@
     year_month_day to_ymd(year_day_of_year dt) BOOST_NOEXCEPT
     {
       bool leap=dt.get_year().is_leap();
- return year_month_day(dt.get_year(), day_of_year_month(leap,dt.get_day_of_year()), day_of_year_day_of_month(leap,dt.get_day_of_year()), no_check);
+ return year_month_day(year(dt.get_year()), month(day_of_year_month(leap,dt.get_day_of_year())), day(day_of_year_day_of_month(leap,dt.get_day_of_year())));
     }
 
 
@@ -131,14 +131,14 @@
         doy = x_ - (days_before_year(y));
       }
       y -= 32799;
- return year_day_of_year(y, doy+1, no_check);
+ return year_day_of_year(year(y), day_of_year(doy+1));
     }
 
 
     year_day_of_year to_ydoy(year_month_day dt) BOOST_NOEXCEPT
     {
       day_of_year::rep doy = month_day_to_day_of_year(dt.get_year().is_leap(),dt.get_month(),dt.get_day());
- return year_day_of_year(dt.get_year(), doy+1, no_check);
+ return year_day_of_year(year(dt.get_year()), day_of_year(doy+1));
     }
 
 

Modified: sandbox/chrono_date/libs/date/src/date.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/date.cpp (original)
+++ sandbox/chrono_date/libs/date/src/date.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -139,24 +139,24 @@
       time(&systime);
       tm now;
       localtime_r(&systime, &now);
- //return chrono::year(now.tm_year+1900,no_check)/chrono::month(now.tm_mon+1,no_check)/chrono::day(now.tm_mday,no_check);
- return date(chrono::year(now.tm_year+1900),chrono::month(now.tm_mon+1),chrono::day(now.tm_mday));
+ //return year(now.tm_year+1900)/month(now.tm_mon+1)/day(now.tm_mday);
+ return date(year(now.tm_year+1900),month(now.tm_mon+1),day(now.tm_mday));
     }
 
- date::date(boost::chrono::system_clock::time_point tp)
+ date::date(system_clock::time_point tp)
     {
- time_t systime = boost::chrono::system_clock::to_time_t(tp);
+ time_t systime = system_clock::to_time_t(tp);
       tm now;
       gmtime_r(&systime, &now);
- *this = date(chrono::year(now.tm_year + 1900)
- , chrono::month(now.tm_mon + 1)
- , chrono::day(now.tm_mday));
-// *this = chrono::year(now.tm_year + 1900, no_check)
-// / chrono::month(now.tm_mon + 1, no_check)
-// / chrono::day(now.tm_mday, no_check);
+ *this = date(year(now.tm_year + 1900)
+ , month(now.tm_mon + 1)
+ , day(now.tm_mday));
+// *this = year(now.tm_year + 1900)
+// / month(now.tm_mon + 1)
+// / day(now.tm_mday);
     }
 
- date::operator boost::chrono::system_clock::time_point() const
+ date::operator system_clock::time_point() const
     {
       tm now =
       { 0 };
@@ -164,7 +164,7 @@
       now.tm_mon = get_month() - 1;
       now.tm_mday = get_day();
       time_t t = timegm(&now);
- return boost::chrono::system_clock::from_time_t(t);
+ return system_clock::from_time_t(t);
     }
 
 #if BOOST_CHRONO_DATE_DATE_DESIGN == 1 || BOOST_CHRONO_DATE_DATE_DESIGN == 3
@@ -240,7 +240,7 @@
 
 #endif
 
- optional_date make_valid_date(year y, month m, day d) BOOST_NOEXCEPT
+ optional_date make_valid_date(year y, month m, day d, check_t) BOOST_NOEXCEPT
     {
       date res;
       if (res.set_if_valid_date(y,m,d)) return optional_date(res);
@@ -248,13 +248,13 @@
 
     }
 
- date::date(chrono::year y, chrono::month m, chrono::day d)
+ date::date(year y, month m, day d, check_t)
     {
       if (set_if_valid_date(y,m,d)) return;
       throw bad_date("day " + to_string(d) + " is out of range for "
           + to_string(y) + '-' + to_string(m));
     }
- date::date(chrono::year y, chrono::month_day md)
+ date::date(year y, month_day md, check_t)
     {
       if (set_if_valid_date(y,md.get_month(), md.get_day())) return;
       throw bad_date("day " + to_string(md.get_day()) + " is out of range for "
@@ -263,7 +263,7 @@
 
 #if BOOST_CHRONO_DATE_DATE_DESIGN == 1
 
- date::date(year::rep y, month::rep m, day::rep d, no_check_t) BOOST_NOEXCEPT
+ date::date(year y, month m, day d) BOOST_NOEXCEPT
         : y_(y), m_(m), d_(d)
     {
       leap_ = is_leap(y_);
@@ -275,7 +275,7 @@
 
 #elif BOOST_CHRONO_DATE_DATE_DESIGN == 2
 
- date::date(year::rep y, month::rep m, day::rep d, no_check_t) BOOST_NOEXCEPT
+ date::date(year y, month::rep m, day d) BOOST_NOEXCEPT
     {
       bool leap = is_leap(y);
       const day_of_year::rep* year_data = days_in_year_before(leap);
@@ -284,7 +284,7 @@
       x_ = days_before_year(by) + year_data[m-1] + d;
     }
 
- date::date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ date::date(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
     {
       const day_of_year::rep* year_data = days_in_year_before(leap);
       year::rep by = y + 32799;
@@ -293,7 +293,7 @@
 
 #elif BOOST_CHRONO_DATE_DATE_DESIGN == 3
 
- date::date(year::rep y, month::rep m, day::rep d, no_check_t) BOOST_NOEXCEPT
+ date::date(year y, month m, day d) BOOST_NOEXCEPT
     : y_(y),
     m_(m),
     d_(d),
@@ -393,14 +393,14 @@
         y += dy;
         m -= 12 * dy;
       }
- *this = chrono::day(d_) / chrono::month(m, no_check) / y;
+ *this = day(d_) / month(m, no_check) / y;
       return *this;
     }
 
     date&
     date::operator+=(years yr)
     {
- *this = chrono::day(d_) / chrono::month(m_, no_check) / (y_ + yr.count());
+ *this = day(d_) / month(m_, no_check) / (y_ + yr.count());
       return *this;
     }
 
@@ -434,7 +434,7 @@
       y += dy;
       m -= 12 * dy;
     }
- *this = chrono::day(d)/chrono::month(m)/y;
+ *this = day(d)/month(m)/y;
     return *this;
   }
 
@@ -453,7 +453,7 @@
     const day_of_year::rep* year_data = days_in_year_before(leap);
     int m = std::lower_bound(year_data, year_data+13, doy) - year_data;
     int d = doy - year_data[m-1];
- *this = date(y + yr.count(), m, d, no_check);
+ *this = date(y + yr.count(), m, d);
     return *this;
   }
 

Modified: sandbox/chrono_date/libs/date/src/days_date.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/days_date.cpp (original)
+++ sandbox/chrono_date/libs/date/src/days_date.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -26,26 +26,26 @@
       time(&systime);
       tm now;
       localtime_r(&systime, &now);
- return days_date(now.tm_year+1900,now.tm_mon+1, now.tm_mday, no_check);
+ return days_date(year(now.tm_year+1900),month(now.tm_mon+1), day(now.tm_mday));
     }
 
- days_date::days_date(boost::chrono::system_clock::time_point tp)
+ days_date::days_date(system_clock::time_point tp)
     {
- time_t systime = boost::chrono::system_clock::to_time_t(tp);
+ time_t systime = system_clock::to_time_t(tp);
       tm now;
       gmtime_r(&systime, &now);
       *this
- = days_date(now.tm_year + 1900, now.tm_mon + 1, now.tm_mday, no_check);
+ = days_date(year(now.tm_year + 1900), month(now.tm_mon + 1), day(now.tm_mday));
     }
 
- days_date::operator boost::chrono::system_clock::time_point() const
+ days_date::operator system_clock::time_point() const
     {
       tm now = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
       now.tm_year = get_year() - 1900;
       now.tm_mon = get_month() - 1;
       now.tm_mday = get_day();
       time_t t = timegm(&now);
- return boost::chrono::system_clock::from_time_t(t);
+ return system_clock::from_time_t(t);
     }
 
     bool days_date::set_if_valid_date(year y, month m, day d)
@@ -64,14 +64,14 @@
 
     }
 
- days_date::days_date(chrono::year y, chrono::month m, chrono::day d)
+ days_date::days_date(year y, month m, day d, check_t)
     {
       if (set_if_valid_date(y, m, d))
         return;
       throw bad_date("day " + to_string(d) + " is out of range for "
           + to_string(y) + '-' + to_string(m));
     }
- days_date::days_date(chrono::year y, chrono::month_day md)
+ days_date::days_date(year y, month_day md, check_t)
     {
       if (set_if_valid_date(y, md.get_month(), md.get_day()))
         return;
@@ -79,7 +79,7 @@
           + to_string(y) + '-' + to_string(md.get_month()));
     }
 
- days_date::days_date(year::rep y, chrono::month_day md, no_check_t)
+ days_date::days_date(year y, month_day md)
     BOOST_NOEXCEPT
     {
       bool leap = is_leap(y);
@@ -88,7 +88,7 @@
       year::rep by = y + 32799;
       x_ = days_before_year(by) + year_data[md.get_month()-1] + md.get_day();
     }
- days_date::days_date(year::rep y, month::rep m, day::rep d, no_check_t)
+ days_date::days_date(year y, month m, day d)
     BOOST_NOEXCEPT
     {
       bool leap = is_leap(y);
@@ -98,7 +98,7 @@
       x_ = days_before_year(by) + year_data[m-1] + d;
     }
 
- days_date::days_date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t)
+ days_date::days_date(year::rep y, month::rep m, day::rep d, bool leap)
     BOOST_NOEXCEPT
     {
       const day_of_year::rep* year_data = days_in_year_before(leap);
@@ -107,7 +107,7 @@
       x_ = days_before_year(by) + year_data[m-1] + d;
     }
 
- days_date::days_date(chrono::year y, chrono::day_of_year doy)
+ days_date::days_date(year y, day_of_year doy, check_t)
     {
       if (!y.is_leap() && doy == 366)
         throw bad_date("doy " + to_string(doy) + " is out of range for year "
@@ -115,7 +115,7 @@
       year::rep by = y + 32799;
       x_ = days_before_year(by) + doy - 1;
     }
- days_date::days_date(year::rep y, day_of_year::rep doy, no_check_t)
+ days_date::days_date(year y, day_of_year doy)
     BOOST_NOEXCEPT
     {
       year::rep by = y + 32799;
@@ -170,7 +170,7 @@
       // std::cout <<__FILE__<<"["<< __LINE__ <<"]"<< y<<":"<<m<<":"<<d << '\n';
       // validity check and assignment
       *this
- = days_date(chrono::year(y), chrono::month(m, no_check), chrono::day(d, no_check));
+ = days_date(year(y, check), month(m, check), day(d, check), check);
 
       return *this;
     }
@@ -192,7 +192,7 @@
       int d = doy - year_data[m - 1];
       // std::cout <<__FILE__<<"["<< __LINE__ <<"]"<< y<<":"<<m<<":"<<d << '\n';
       *this
- = days_date(chrono::year(y + yr.count()), chrono::month(m, no_check), chrono::day(d));
+ = days_date(year(y + yr.count(), check), month(m, check), day(d, check), check);
       return *this;
     }
 

Modified: sandbox/chrono_date/libs/date/src/rel_date.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/rel_date.cpp (original)
+++ sandbox/chrono_date/libs/date/src/rel_date.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -63,7 +63,7 @@
 
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::day d)
+ rel_date::rel_date(year y, month m, day d)
     :
     y_(y),
     m_(m),
@@ -83,7 +83,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::day d)
+ rel_date::rel_date(year y, month m, day d)
     {
       bool leap = is_leap(y);
       const day_of_year::rep* year_data = days_in_year_before(leap);
@@ -96,7 +96,7 @@
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::day d)
+ rel_date::rel_date(year y, month m, day d)
     :
     y_(y),
     m_(m),
@@ -115,7 +115,7 @@
 #endif
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 
- rel_date::rel_date(chrono::year::rep y, chrono::month::rep m, chrono::day::rep d, no_check_t) BOOST_NOEXCEPT
+ rel_date::rel_date(year y, month m, day d) BOOST_NOEXCEPT
     :
     y_(y),
     m_(m),
@@ -131,7 +131,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 
- rel_date::rel_date(chrono::year::rep y, chrono::month::rep m, chrono::day::rep d, no_check_t)BOOST_NOEXCEPT
+ rel_date::rel_date(year y, month m, day d)BOOST_NOEXCEPT
     {
       bool leap = is_leap(y);
       const day_of_year::rep* year_data = days_in_year_before(leap);
@@ -140,7 +140,7 @@
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 
- rel_date::rel_date(chrono::year::rep y, chrono::month::rep m, chrono::day::rep d, no_check_t)BOOST_NOEXCEPT
+ rel_date::rel_date(year y, month m, day d)BOOST_NOEXCEPT
     :
     y_(y),
     m_(m),
@@ -154,7 +154,7 @@
 
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 
- rel_date::rel_date(chrono::year y, chrono::month_day md)
+ rel_date::rel_date(year y, month_day md, check_t)
     :
     y_(y),
     m_(md.get_month()),
@@ -174,7 +174,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 
- rel_date::rel_date(chrono::year y, chrono::month_day md)
+ rel_date::rel_date(year y, month_day md, check_t)
     {
       bool leap = is_leap(y);
       const day_of_year::rep* year_data = days_in_year_before(leap);
@@ -187,7 +187,7 @@
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 
- rel_date::rel_date(chrono::year y, chrono::month_day md)
+ rel_date::rel_date(year y, month_day md, check_t)
     :
     y_(y),
     m_(md.get_month()),
@@ -207,7 +207,7 @@
 
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 
- rel_date::rel_date(chrono::year::rep y, chrono::month_day md, no_check_t)
+ rel_date::rel_date(year::rep y, month_day md)
     BOOST_NOEXCEPT :
     y_(y),
     m_(md.get_month()),
@@ -223,7 +223,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 
- rel_date::rel_date(chrono::year::rep y, chrono::month_day md, no_check_t)
+ rel_date::rel_date(year::rep y, month_day md)
     BOOST_NOEXCEPT {
       bool leap = is_leap(y);
       const day_of_year::rep* year_data = days_in_year_before(leap);
@@ -232,7 +232,7 @@
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 
- rel_date::rel_date(chrono::year::rep y, chrono::month_day md, no_check_t)
+ rel_date::rel_date(year::rep y, month_day md)
     BOOST_NOEXCEPT :
     y_(y),
     m_(md.get_month()),
@@ -244,7 +244,7 @@
     }
 #endif
 
- rel_date::rel_date(chrono::days d)
+ rel_date::rel_date(days d)
     {
       if (set_if_valid_date(d))
         return;
@@ -252,7 +252,7 @@
     }
 
 
- rel_date::rel_date(chrono::year y, chrono::day_of_year doy)
+ rel_date::rel_date(year y, day_of_year doy)
     {
       if (set_if_valid_date(y, doy))
         return;
@@ -262,7 +262,7 @@
 
 //#if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 //
-// rel_date::rel_date(year::rep y, day_of_year::rep d, no_check_t) // TODO
+// rel_date::rel_date(year::rep y, day_of_year::rep d) // TODO
 // BOOST_NOEXCEPT
 // {
 //
@@ -272,7 +272,7 @@
 //
 //#elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 //
-// rel_date::rel_date(year::rep y, day_of_year::rep d, no_check_t)// TODO
+// rel_date::rel_date(year::rep y, day_of_year::rep d)// TODO
 // BOOST_NOEXCEPT
 // {
 //
@@ -281,7 +281,7 @@
 //
 //#elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 //
-// rel_date::rel_date(year::rep y, day_of_year::rep d, no_check_t)// TODO
+// rel_date::rel_date(year::rep y, day_of_year::rep d)// TODO
 // BOOST_NOEXCEPT
 // {
 //
@@ -475,9 +475,9 @@
 
     bool rel_date::is_valid() const BOOST_NOEXCEPT
     {
- if (year(y_,no_check).is_valid() && month(m_,no_check).is_valid())
+ if (year(y_).is_valid() && month(m_).is_valid())
       {
- if (d_!=0 && day(d_, no_check).is_valid()) {
+ if (d_!=0 && day(d_).is_valid()) {
         const day_of_year::rep* year_data = days_in_year_before(leap_);
 
         if (!(1 <= d_ && d_ <= year_data[m_] - year_data[m_ - 1]))
@@ -503,22 +503,22 @@
       time(&systime);
       tm now;
       localtime_r(&systime, &now);
- return rel_date(chrono::year(now.tm_year+1900,no_check),
- chrono::month(now.tm_mon+1,no_check),
- chrono::day(now.tm_mday,no_check));
+ return rel_date(year(now.tm_year+1900),
+ month(now.tm_mon+1),
+ day(now.tm_mday));
     }
 
- rel_date::rel_date(boost::chrono::system_clock::time_point tp)
+ rel_date::rel_date(system_clock::time_point tp)
     {
- time_t systime = boost::chrono::system_clock::to_time_t(tp);
+ time_t systime = system_clock::to_time_t(tp);
       tm now;
       gmtime_r(&systime, &now);
       *this
- = rel_date(chrono::year(now.tm_year + 1900, no_check), chrono::month(now.tm_mon
- + 1, no_check), chrono::day(now.tm_mday, no_check));
+ = rel_date(year(now.tm_year + 1900), month(now.tm_mon
+ + 1), day(now.tm_mday));
     }
 
- rel_date::operator boost::chrono::system_clock::time_point() const
+ rel_date::operator system_clock::time_point() const
     {
       tm now =
       { 0 };
@@ -526,7 +526,7 @@
       now.tm_mon = get_month() - 1;
       now.tm_mday = get_day();
       time_t t = timegm(&now);
- return boost::chrono::system_clock::from_time_t(t);
+ return system_clock::from_time_t(t);
     }
 
 #endif //BOOST_CHRONO_DATE_REL_DATE_IS_A_MODEL_OF_DATE
@@ -545,7 +545,7 @@
 // }
     rel_date::operator ymd_date() const
     {
- return date(x_, y_, m_, d_, leap_, no_check);
+ return date(x_, y_, m_, d_, leap_);
     }
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
@@ -557,7 +557,7 @@
 // }
     rel_date::operator ymd_date() const
     {
- return date(x_, no_check);
+ return date(x_);
 
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
@@ -574,7 +574,7 @@
 // }
     rel_date::operator ymd_date() const
     {
- return date(y_,m_,d_,leap_,no_check);
+ return date(y_,m_,d_,leap_);
 
     }
 #endif
@@ -594,7 +594,7 @@
 // }
     rel_date::operator days_date() const
     {
- return date(x_, no_check);
+ return date(x_);
     }
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
@@ -606,7 +606,7 @@
 // }
     rel_date::operator days_date() const
     {
- return date(x_, no_check);
+ return date(x_);
 
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
@@ -623,7 +623,7 @@
 // }
     rel_date::operator days_date() const
     {
- return date(y_,m_,d_,leap_,no_check);
+ return date(y_,m_,d_,leap_);
 
     }
 #endif
@@ -643,7 +643,7 @@
 // }
     rel_date::operator ydoy_date() const
     {
- return date(x_, y_, m_, d_, leap_, no_check);
+ return date(x_, y_, m_, d_, leap_);
     }
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
@@ -655,7 +655,7 @@
 // }
     rel_date::operator ydoy_date() const
     {
- return date(x_, no_check);
+ return date(x_);
 
     }
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
@@ -672,13 +672,13 @@
 // }
     rel_date::operator ydoy_date() const
     {
- return date(y_,m_,d_,leap_,no_check);
+ return date(y_,m_,d_,leap_);
 
     }
 #endif
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::nth_weekday d) :
+ rel_date::rel_date(year y, month m, nth_weekday d) :
     y_(y.value()),
     m_(m.value()),
     dow_(d.get_weekday()),
@@ -759,7 +759,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::nth_weekday nwd) :
+ rel_date::rel_date(year y, month m, nth_weekday nwd) :
       n_(nwd.get_nth()), dow_(nwd.get_weekday())
     {
       bool leap = y.is_leap();
@@ -846,7 +846,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::nth_weekday rd)
+ rel_date::rel_date(year y, month m, nth_weekday rd)
     : y_(y.value()),
     m_(m.value()),
     leap_(0),
@@ -857,7 +857,7 @@
     {
       std::cout <<" =========== d= "<< int(d_) << std::endl;
 
- leap_ = year(y,no_check).is_leap();
+ leap_ = year(y).is_leap();
       const day_of_year::rep* year_data = days_in_year_before(leap_);
       if (n_ != nth_week::not_applicable) // if a nth is involved
 
@@ -935,7 +935,7 @@
 
 #if BOOST_CHRONO_DATE_REL_DATE_DESIGN == 1
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::nth n) :
+ rel_date::rel_date(year y, month m, nth n) :
     y_(y.value()),
     m_(m.value()),
     dow_(weekday::not_applicable),
@@ -944,7 +944,7 @@
     {
       leap_ = year(y_).is_leap();
       const day_of_year::rep* year_data = days_in_year_before(leap_);
- if (n_ != nth::not_applicable) // if a nth is involved
+ if (n_ != nth_week::not_applicable) // if a nth is involved
 
       {
         if (dow_ == weekday::not_applicable) // if we want nth day of month
@@ -1016,12 +1016,12 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 2
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::nth n) :
+ rel_date::rel_date(year y, month m, nth n) :
       n_(n.value()), dow_(weekday::not_applicable)
     {
       bool leap = y.is_leap();
       const day_of_year::rep* year_data = days_in_year_before(leap);
- if (n_ != nth::not_applicable) // if a nth is involved
+ if (n_ != nth_week::not_applicable) // if a nth is involved
 
       {
         if (dow_ == weekday::not_applicable) // if we want nth day of month
@@ -1103,7 +1103,7 @@
 
 #elif BOOST_CHRONO_DATE_REL_DATE_DESIGN == 3
 
- rel_date::rel_date(chrono::year y, chrono::month m, chrono::nth n)
+ rel_date::rel_date(year y, month m, nth n)
     : y_(y.value()),
     m_(m.value()),
     leap_(0),
@@ -1112,9 +1112,9 @@
     d_(0),
     n_(n.value())
     {
- leap_ = year(y,no_check).is_leap();
+ leap_ = year(y).is_leap();
       const day_of_year::rep* year_data = days_in_year_before(leap_);
- if (n_ != nth::not_applicable) // if a nth is involved
+ if (n_ != nth_week::not_applicable) // if a nth is involved
 
       {
         if (dow_ == weekday::not_applicable) // if we want nth day of month
@@ -1202,7 +1202,7 @@
 // doy = x_ - (y * 365 + y / 4 - y / 100 + y / 400);
 // }
 // y_ = static_cast<int16_t> (y - 32799);
-// leap_ = year(y, no_check).is_leap();
+// leap_ = year(y).is_leap();
 // const day_of_year::rep* year_data = days_in_year_before(leap_);
 // m_ = static_cast<uint16_t> (std::lower_bound(year_data, year_data + 13, doy)
 // - year_data);
@@ -1281,9 +1281,9 @@
         m -= 12 * dy;
       }
       //if (d_==0)
- *this = chrono::nth_weekday(nth_week(n_,no_check), weekday(dow_,no_check)) / chrono::month(m, no_check) / y;
+ *this = nth_weekday(nth_week(n_), weekday(dow_)) / month(m) / y;
       //else
- //*this = rel_date(year(y), chrono::month(m, no_check), chrono::day(d_,no_check));
+ //*this = rel_date(year(y), month(m), day(d_));
       return *this;
     }
 
@@ -1291,9 +1291,9 @@
     rel_date::operator+=(years yr)
     {
       //if (d_==0)
- *this = chrono::nth_weekday(nth_week(n_,no_check), weekday(dow_,no_check)) / chrono::month(m_, no_check) / (y_ + yr.count());
+ *this = nth_weekday(nth_week(n_), weekday(dow_)) / month(m_) / (y_ + yr.count());
       //else
- //*this = rel_date(year(y_+ yr.count()), chrono::month(m_, no_check), chrono::day(d_,no_check));
+ //*this = rel_date(year(y_+ yr.count()), month(m_), day(d_));
       return *this;
 
     }
@@ -1327,8 +1327,8 @@
         y += dy;
         m -= 12 * dy;
       }
- *this = chrono::nth_weekday(nth_week(n_), weekday(dow_, no_check))
- / chrono::month(m, no_check) / y;
+ *this = nth_weekday(nth_week(n_), weekday(dow_))
+ / month(m) / y;
       return *this;
     }
 
@@ -1346,8 +1346,8 @@
       bool leap = year(y).is_leap();
       const day_of_year::rep* year_data = days_in_year_before(leap);
       int m = std::lower_bound(year_data, year_data + 13, doy) - year_data;
- *this = chrono::nth_weekday(nth_week(n_), weekday(dow_, no_check))
- / chrono::month(m, no_check) / (y + yr.count());
+ *this = nth_weekday(nth_week(n_), weekday(dow_))
+ / month(m) / (y + yr.count());
       return *this;
     }
 
@@ -1435,8 +1435,8 @@
     year_month_day to_ymd(year_week_weekday p)
     BOOST_NOEXCEPT
     {
- date dt = (mon <= jan / day(4,no_check) / p.get_year()) + days((p.get_week().value() - 1) * weekday::size + (p.get_weekday().value() == 0 ? weekday::size-1 : p.get_weekday().value() - 1));
- return year_month_day(dt.get_year(), dt.get_month(), dt.get_day(), no_check);
+ date dt = (mon <= jan / day(4) / p.get_year()) + days((p.get_week().value() - 1) * weekday::size + (p.get_weekday().value() == 0 ? weekday::size-1 : p.get_weekday().value() - 1));
+ return year_month_day(dt.get_year(), dt.get_month(), dt.get_day());
     }
 
     year_day_of_year to_ydoy(year_week_weekday dt)
@@ -1454,7 +1454,7 @@
     year_week_weekday to_ywwd(year_month_day ymd)
     BOOST_NOEXCEPT
     {
- date dt(ymd.get_year(), ymd.get_month(), ymd.get_day(), no_check);
+ date dt(ymd.get_year(), ymd.get_month(), ymd.get_day());
       month_day jan4 = jan / day(4);
       date start = mon <= jan4 / ymd.get_year();
       if (dt < start)
@@ -1470,8 +1470,7 @@
       return year_week_weekday(
           (thu > start).get_year(),
           (dt - start).count() / weekday::size + 1,
- dt.get_weekday(),
- no_check
+ dt.get_weekday()
       );
     }
 

Modified: sandbox/chrono_date/libs/date/src/vars.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/vars.cpp (original)
+++ sandbox/chrono_date/libs/date/src/vars.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -18,6 +18,8 @@
   namespace chrono
   {
 
+#ifdef BOOST_NO_CXX11_CONSTEXPR
+
     const weekday sun(0);
     const weekday mon(1);
     const weekday tue(2);
@@ -39,6 +41,7 @@
     const month nov(11);
     const month dec(12);
 
+#endif
 // const nth_week _1st_week(1);
 // const nth_week _2nd_week(2);
 // const nth_week _3rd_week(3);
@@ -53,64 +56,64 @@
 // const nth _5th(5);
 // const nth last(6);
 
- const month_nth jan_1st(1, 1, no_check);
+ const month_nth jan_1st(month(1), 1);
 
- const month_day jan_01(1, 1, no_check);
- const month_day jan_02(1, 2, no_check);
- const month_day jan_03(1, 3, no_check);
- const month_day jan_04(1, 4, no_check);
- const month_day jan_05(1, 5, no_check);
- const month_day jan_06(1, 6, no_check);
- const month_day jan_07(1, 7, no_check);
- const month_day jan_08(1, 8, no_check);
- const month_day jan_09(1, 9, no_check);
- const month_day jan_10(1, 10, no_check);
- const month_day jan_11(1, 11, no_check);
- const month_day jan_12(1, 12, no_check);
- const month_day jan_13(1, 13, no_check);
- const month_day jan_14(1, 14, no_check);
- const month_day jan_15(1, 15, no_check);
- const month_day jan_16(1, 16, no_check);
- const month_day jan_17(1, 17, no_check);
- const month_day jan_18(1, 18, no_check);
- const month_day jan_19(1, 19, no_check);
- const month_day jan_20(1, 20, no_check);
- const month_day jan_21(1, 21, no_check);
- const month_day jan_22(1, 22, no_check);
- const month_day jan_23(1, 23, no_check);
- const month_day jan_24(1, 24, no_check);
- const month_day jan_25(1, 25, no_check);
- const month_day jan_26(1, 26, no_check);
- const month_day jan_27(1, 27, no_check);
- const month_day jan_28(1, 28, no_check);
- const month_day jan_29(1, 29, no_check);
- const month_day jan_30(1, 30, no_check);
- const month_day jan_31(1, 31, no_check);
+ const month_day jan_01(month(1), day( 1));
+ const month_day jan_02(month(1), day( 2));
+ const month_day jan_03(month(1), day( 3));
+ const month_day jan_04(month(1), day( 4));
+ const month_day jan_05(month(1), day( 5));
+ const month_day jan_06(month(1), day( 6));
+ const month_day jan_07(month(1), day( 7));
+ const month_day jan_08(month(1), day( 8));
+ const month_day jan_09(month(1), day( 9));
+ const month_day jan_10(month(1), day( 10));
+ const month_day jan_11(month(1), day( 11));
+ const month_day jan_12(month(1), day( 12));
+ const month_day jan_13(month(1), day( 13));
+ const month_day jan_14(month(1), day( 14));
+ const month_day jan_15(month(1), day( 15));
+ const month_day jan_16(month(1), day( 16));
+ const month_day jan_17(month(1), day( 17));
+ const month_day jan_18(month(1), day( 18));
+ const month_day jan_19(month(1), day( 19));
+ const month_day jan_20(month(1), day( 20));
+ const month_day jan_21(month(1), day( 21));
+ const month_day jan_22(month(1), day( 22));
+ const month_day jan_23(month(1), day( 23));
+ const month_day jan_24(month(1), day( 24));
+ const month_day jan_25(month(1), day( 25));
+ const month_day jan_26(month(1), day( 26));
+ const month_day jan_27(month(1), day( 27));
+ const month_day jan_28(month(1), day( 28));
+ const month_day jan_29(month(1), day( 29));
+ const month_day jan_30(month(1), day( 30));
+ const month_day jan_31(month(1), day( 31));
 
 
- static const day::rep days_in_month_[2][13] =
+ BOOST_STATIC_CONSTEXPR day::rep days_in_month_[2][13] =
     {
     { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
     { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
     };
 
 
- days year::days_in(month m) const BOOST_NOEXCEPT
- {
- return days(days_in_month_[is_leap()][m]);
- }
+// days year::days_in_month(month m) const BOOST_NOEXCEPT
+// {
+// return days(days_in_month_[is_leap()][m]);
+// }
     day::rep days_in_month(bool leap, month::rep m) BOOST_NOEXCEPT
     {
       return days_in_month_[leap][m];
     }
 
 
- static const day_of_year::rep days_in_year_before_[2][13] =
+ BOOST_STATIC_CONSTEXPR day_of_year::rep days_in_year_before_[2][13] =
     {
     { -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364 },
     { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 } };
 
- static const month::rep
+ BOOST_STATIC_CONSTEXPR month::rep
         day_of_year_month_[2][366] =
             {
             { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 1
1, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12 },
@@ -119,7 +122,7 @@
 
             } };
 
- static const day::rep
+ BOOST_STATIC_CONSTEXPR day::rep
         day_of_year_day_of_month_[2][366] =
             {
             { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 3
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0 // no leap years have 365 days
@@ -130,7 +133,7 @@
 
             };
 
- static const day_of_year::rep
+ BOOST_STATIC_CONSTEXPR day_of_year::rep
         month_day_to_day_of_year_[2][12][31] =
             {
             { // no_leap

Modified: sandbox/chrono_date/libs/date/src/ydoy_date.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/ydoy_date.cpp (original)
+++ sandbox/chrono_date/libs/date/src/ydoy_date.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -35,30 +35,30 @@
       tm now;
       localtime_r(&systime, &now);
       return ydoy_date(
- chrono::year(now.tm_year+1900),
- chrono::month(now.tm_mon+1),
- chrono::day(now.tm_mday)
+ year(now.tm_year+1900),
+ month(now.tm_mon+1),
+ day(now.tm_mday)
       );
     }
 
- ydoy_date::ydoy_date(boost::chrono::system_clock::time_point tp)
+ ydoy_date::ydoy_date(system_clock::time_point tp)
     {
- time_t systime = boost::chrono::system_clock::to_time_t(tp);
+ time_t systime = system_clock::to_time_t(tp);
       tm now;
       gmtime_r(&systime, &now);
       *this
- = ydoy_date(chrono::year(now.tm_year + 1900), chrono::month(now.tm_mon
- + 1), chrono::day(now.tm_mday));
+ = ydoy_date(year(now.tm_year + 1900), month(now.tm_mon
+ + 1), day(now.tm_mday));
     }
 
- ydoy_date::operator boost::chrono::system_clock::time_point() const
+ ydoy_date::operator system_clock::time_point() const
     {
       tm now = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
       now.tm_year = get_year() - 1900;
       now.tm_mon = get_month() - 1;
       now.tm_mday = get_day();
       time_t t = timegm(&now);
- return boost::chrono::system_clock::from_time_t(t);
+ return system_clock::from_time_t(t);
     }
 
     bool ydoy_date::set_if_valid_date(year y, month m, day d)
@@ -77,7 +77,7 @@
       return true;
     }
 
-// ydoy_date::ydoy_date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+// ydoy_date::ydoy_date(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
 // :
 // y_(y),
 // doy_(month_day_to_day_of_year(leap,m,d)),
@@ -94,7 +94,7 @@
 //
 // }
 
- ydoy_date::ydoy_date(chrono::year y, chrono::month m, chrono::day d)
+ ydoy_date::ydoy_date(year y, month m, day d, check_t)
     {
       if (set_if_valid_date(y, m, d))
         return;
@@ -102,7 +102,7 @@
           + to_string(y) + '-' + to_string(m));
     }
 
- ydoy_date::ydoy_date(chrono::year y, chrono::month_day md)
+ ydoy_date::ydoy_date(year y, month_day md, check_t)
     {
       if (set_if_valid_date(y, md.get_month(), md.get_day()))
         return;
@@ -110,7 +110,7 @@
           + to_string(y) + '-' + to_string(md.get_month()));
     }
 
- ydoy_date::ydoy_date(year::rep y, month::rep m, day::rep d, no_check_t)
+ ydoy_date::ydoy_date(year y, month m, day d)
     BOOST_NOEXCEPT
     :
     y_(y),
@@ -119,7 +119,7 @@
     {
     }
 
- ydoy_date::ydoy_date(year::rep y, month_day md, no_check_t)
+ ydoy_date::ydoy_date(year y, month_day md)
     BOOST_NOEXCEPT
     :
     y_(y),
@@ -155,7 +155,7 @@
       doy_ = doy;
     }
 
- ydoy_date::ydoy_date(days d)
+ ydoy_date::ydoy_date(days d, check_t)
     {
       days::rep x = d.count();
       if (!(11322 <= x && x <= 23947853))
@@ -183,8 +183,9 @@
       doy_ = doy;
     }
 
- ydoy_date::ydoy_date(days::rep x, no_check_t) BOOST_NOEXCEPT
+ ydoy_date::ydoy_date(days d) BOOST_NOEXCEPT
     {
+ days::rep x = d.count();
       year::rep y = to_average_year(x);
       int doy = x - (days_before_year(y));
       if (doy < 0)
@@ -199,7 +200,7 @@
       doy_ = doy;
     }
 
- ydoy_date::ydoy_date(chrono::year y, chrono::day_of_year doy)
+ ydoy_date::ydoy_date(year y, day_of_year doy, check_t)
     : y_(y),
       doy_(doy),
       leap_(is_leap(y_))
@@ -208,7 +209,7 @@
         throw bad_date("non leap years have no 366 days");
     }
 
- ydoy_date::ydoy_date(chrono::year::rep y, chrono::day_of_year::rep doy, no_check_t) BOOST_NOEXCEPT
+ ydoy_date::ydoy_date(year y, day_of_year doy) BOOST_NOEXCEPT
     : y_(y),
       doy_(doy),
       leap_(is_leap(y_))
@@ -258,14 +259,14 @@
         m -= 12 * dy;
       }
       std::cout << __LINE__ <<": "<<m<< std::endl;
- *this = ydoy_date(chrono::year(y), month(m,no_check), get_day());
+ *this = ydoy_date(year(y, check), month(m), get_day(), check);
       return *this;
     }
 
     ydoy_date&
     ydoy_date::operator+=(years yr)
     {
- *this = ydoy_date(chrono::year(y_ + yr.count()), get_month(), get_day());
+ *this = ydoy_date(year(y_ + yr.count(), check), get_month(), get_day(), check);
       return *this;
     }
 

Modified: sandbox/chrono_date/libs/date/src/ymd_date.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/src/ymd_date.cpp (original)
+++ sandbox/chrono_date/libs/date/src/ymd_date.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -41,36 +41,36 @@
       tm now;
       localtime_r(&systime, &now);
       return ymd_date(
- chrono::year(now.tm_year+1900),
- chrono::month(now.tm_mon+1),
- chrono::day(now.tm_mday)
+ year(now.tm_year+1900),
+ month(now.tm_mon+1),
+ day(now.tm_mday)
       );
     }
 
- ymd_date::ymd_date(boost::chrono::system_clock::time_point tp)
+ ymd_date::ymd_date(system_clock::time_point tp)
     {
- time_t systime = boost::chrono::system_clock::to_time_t(tp);
+ time_t systime = system_clock::to_time_t(tp);
       tm now;
       gmtime_r(&systime, &now);
       *this
- = ymd_date(chrono::year(now.tm_year + 1900), chrono::month(now.tm_mon
- + 1), chrono::day(now.tm_mday));
+ = ymd_date(year(now.tm_year + 1900), month(now.tm_mon
+ + 1), day(now.tm_mday));
     }
 
- ymd_date::operator boost::chrono::system_clock::time_point() const
+ ymd_date::operator system_clock::time_point() const
     {
       tm now = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
       now.tm_year = get_year() - 1900;
       now.tm_mon = get_month() - 1;
       now.tm_mday = get_day();
       time_t t = timegm(&now);
- return boost::chrono::system_clock::from_time_t(t);
+ return system_clock::from_time_t(t);
     }
 
     bool ymd_date::is_valid() const
     BOOST_NOEXCEPT
     {
- if (year(y_,no_check).is_valid() && month(m_,no_check).is_valid() && day(d_, no_check).is_valid()) {
+ if (year(y_).is_valid() && month(m_).is_valid() && day(d_).is_valid()) {
         const day_of_year::rep* year_data = days_in_year_before(leap_);
 
         if (!(1 <= d_ && d_ <= year_data[m_] - year_data[m_ - 1]))
@@ -90,37 +90,37 @@
     bool ymd_date::set_if_valid_date(year y, month m, day d)
     BOOST_NOEXCEPT
     {
- bool leap = is_leap(y);
+ bool leap = y.is_leap();
       const day_of_year::rep* year_data = days_in_year_before(leap);
 
       if (!(d <= year_data[m] - year_data[m - 1]))
       {
         return false;
       }
- y_ = y.value();
- m_ = m.value();
- d_ = d.value();
+ y_ = y;
+ m_ = m;
+ d_ = d;
       leap_ = leap;
 #if BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 1
- year::rep by = y.value() + 32799;
+ year::rep by = y + 32799;
       x_ = days_before_year(by) + year_data[m - 1] + d;
 #endif
       return true;
     }
 
- bool ymd_date::set_if_valid_date(chrono::year y, chrono::day_of_year doy)
+ bool ymd_date::set_if_valid_date(year y, day_of_year doy)
     BOOST_NOEXCEPT
     {
- bool leap = is_leap(y);
+ bool leap = y.is_leap();
       if (!leap && doy == 366)
          return false;
 
- y_ = y.value();
- m_ = day_of_year_month(leap,doy);
+ y_ = y;
+ m_ = day_of_year_month(leap, doy);
       d_ = day_of_year_day_of_month(leap,doy);
       leap_ = leap;
 #if BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 1
- year::rep by = y.value() + 32799;
+ year::rep by = y + 32799;
       x_ = days_before_year(by) + doy -1;
 #endif
       return true;
@@ -146,7 +146,7 @@
 
 
 #if BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 1
- ymd_date::ymd_date(year::rep y, month::rep m, day::rep d, bool leap, no_check_t) BOOST_NOEXCEPT
+ ymd_date::ymd_date(year::rep y, month::rep m, day::rep d, bool leap) BOOST_NOEXCEPT
         :
         y_(y),
         m_(m),
@@ -159,7 +159,7 @@
     }
 #endif
 
- ymd_date::ymd_date(chrono::year y, chrono::month m, chrono::day d)
+ ymd_date::ymd_date(year y, month m, day d, check_t)
     {
       if (set_if_valid_date(y, m, d))
         return;
@@ -167,7 +167,7 @@
           + to_string(y) + '-' + to_string(m));
     }
 
- ymd_date::ymd_date(chrono::year y, chrono::month_day md)
+ ymd_date::ymd_date(year y, month_day md, check_t)
     {
       if (set_if_valid_date(y, md.get_month(), md.get_day()))
         return;
@@ -175,7 +175,7 @@
           + to_string(y) + '-' + to_string(md.get_month()));
     }
 
- ymd_date::ymd_date(year::rep y, month::rep m, day::rep d, no_check_t)
+ ymd_date::ymd_date(year y, month m, day d)
     BOOST_NOEXCEPT
     : y_(y), m_(m), d_(d), leap_(is_leap(y_))
     {
@@ -188,7 +188,7 @@
       x_ = days_before_year(by) + year_data[m_ - 1] + d_;
 #endif
     }
- ymd_date::ymd_date(year::rep y, month_day md, no_check_t)
+ ymd_date::ymd_date(year y, month_day md)
     BOOST_NOEXCEPT
     : y_(y), m_(md.get_month()), d_(md.get_day()), leap_(is_leap(y_))
     {
@@ -200,8 +200,22 @@
 #endif
     }
 
+ ymd_date::ymd_date(year y, day_of_year doy) BOOST_NOEXCEPT
+ {
+ if (set_if_valid_date(y, doy))
+ return;
 
- ymd_date::ymd_date(chrono::year y, chrono::day_of_year doy)
+ y_ = y;
+ m_ = 0;
+ d_ = 0;
+ leap_ = false;
+#if BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 1
+ x_ = 0;
+#endif
+
+ }
+
+ ymd_date::ymd_date(year y, day_of_year doy, check_t)
     {
       if (set_if_valid_date(y, doy))
         return;
@@ -209,18 +223,19 @@
           + to_string(y) );
     }
 
- ymd_date::ymd_date(days d)
+ ymd_date::ymd_date(days d, check_t)
     {
       if (set_if_valid_date(d))
         return;
       throw bad_date("days " + to_string(d.count()) + " is out of range");
     }
- ymd_date::ymd_date(days::rep x, no_check_t) BOOST_NOEXCEPT
+
+ ymd_date::ymd_date(days d) BOOST_NOEXCEPT
 #if BOOST_CHRONO_DATE_YMD_DATE_DESIGN == 1
- : x_(x)
+ : x_(d)
 #endif
         {
- year_month_day_leap dt = to_ymd_leap(days(x));
+ year_month_day_leap dt = to_ymd_leap(d);
             y_=dt.get_year();
             m_=dt.get_month();
             d_=dt.get_day();
@@ -288,7 +303,7 @@
         m -= 12 * dy;
       }
       *this
- = ymd_date(chrono::year(y), chrono::month(m, no_check), chrono::day(d_, no_check));
+ = ymd_date(year(y, check), month(m), day(d_), check);
       return *this;
     }
 
@@ -296,7 +311,7 @@
     ymd_date::operator+=(years yr)
     {
       *this
- = ymd_date(chrono::year(y_ + yr.count()), chrono::month(m_, no_check), chrono::day(d_, no_check));
+ = ymd_date(year(y_ + yr.count(), check), month(m_, check), day(d_, check), check);
       return *this;
     }
 

Modified: sandbox/chrono_date/libs/date/test/Jamfile.v2
==============================================================================
--- sandbox/chrono_date/libs/date/test/Jamfile.v2 (original)
+++ sandbox/chrono_date/libs/date/test/Jamfile.v2 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -47,6 +47,15 @@
         <toolset>darwin:<cxxflags>-Wextra
         <toolset>darwin:<cxxflags>-pedantic
         <toolset>darwin:<cxxflags>-Wno-long-long
+ <toolset>darwin-4.6.2:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.1:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.2:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.8.0:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.6.2x:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.1x:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.7.2x:<cxxflags>-Wno-unused-local-typedefs
+ <toolset>darwin-4.8.0x:<cxxflags>-Wno-unused-local-typedefs
+
         <toolset>gcc:<cxxflags>-Wextra
         <toolset>gcc:<cxxflags>-pedantic
         <toolset>gcc:<cxxflags>-Wno-long-long

Modified: sandbox/chrono_date/libs/date/test/dates/days/days_date_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/dates/days/days_date_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/dates/days/days_date_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -23,18 +23,18 @@
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.days_since_epoch().count()==11979588);
   }
+// { // unchecked construct from bad ymd: 0/0/0 results in valid date
+// days_date dt(year(0),month(0),day(0));
+// std::cout <<"0/0/0 days "<< dt.days_since_epoch().count() << std::endl;
+// BOOST_TEST( dt.is_valid());
+// }
   { // unchecked construct from bad ymd: 0/0/0 results in valid date
- days_date dt(0,0,0,no_check);
- std::cout <<"0/0/0 days "<< dt.days_since_epoch().count() << std::endl;
- BOOST_TEST( dt.is_valid());
- }
- { // unchecked construct from bad ymd: 0/0/0 results in valid date
- days_date dt(40000,1,1,no_check);
+ days_date dt(year(40000),month(1),day(1));
     BOOST_TEST( ! dt.is_valid());
   }
   { // bad construction from bad days: 0
     try {
- days_date dt(days(0));
+ days_date dt(days(0), check);
       BOOST_TEST( false );
     } catch (...) {}
   }
@@ -54,28 +54,28 @@
     BOOST_TEST(dt.get_day()==1);
   }
   { // construct from ymd: 2011/oct/22
- days_date dt(year(2011),oct,day(22));
+ days_date dt(year(2011),oct,day(22), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
     BOOST_TEST(dt.get_day()==22);
   }
   { // no_check construct from bad ymd: 2011/oct/22
- days_date dt(2011,10,22, no_check);
+ days_date dt(year(2011),oct,day(22));
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
     BOOST_TEST(dt.get_day()==22);
   }
   { // construct from ymd: 2011/jan_01
- days_date dt(year(2011),jan_01);
+ days_date dt(year(2011),jan_01, check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
     BOOST_TEST(dt.get_day()==1);
   }
   { // no_check construct from ymd: 2011/jan_01
- days_date dt(2011,jan_01, no_check);
+ days_date dt(year(2011),jan_01);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
@@ -144,7 +144,7 @@
 
   { // construct from bad (year + doy):
     try {
- days_date dt(year(2011), day_of_year(366));
+ days_date dt(year(2011), day_of_year(366), check);
     BOOST_TEST( false );
     } catch (...) {}
   }
@@ -156,49 +156,49 @@
     BOOST_TEST( dt.is_valid());
   }
   { // conversions to/from system_clock::time_point
- days_date dt(2011,10,22, no_check);
+ days_date dt(year(2011),oct,day(22));
     boost::chrono::system_clock::time_point tp=boost::chrono::system_clock::time_point(dt);
     days_date dt2(tp);
     BOOST_TEST( dt == dt2);
   }
   // is_leap_year
   {
- days_date dt(2011,10,22, no_check);
+ days_date dt(year(2011),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- days_date dt(0,10,22, no_check);
+ days_date dt(year(0),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- days_date dt(4,10,22, no_check);
+ days_date dt(year(4),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- days_date dt(400,10,22, no_check);
+ days_date dt(year(400),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- days_date dt(100,10,22, no_check);
+ days_date dt(year(100),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- days_date dt(200,10,22, no_check);
+ days_date dt(year(200),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- days_date dt(300,10,22, no_check);
+ days_date dt(year(300),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   // get_weekday
   {
- BOOST_TEST( days_date(2011,10,23, no_check).get_weekday()==sun);
- BOOST_TEST( days_date(2011,10,24, no_check).get_weekday()==mon);
- BOOST_TEST( days_date(2011,10,25, no_check).get_weekday()==tue);
- BOOST_TEST( days_date(2011,10,26, no_check).get_weekday()==wed);
- BOOST_TEST( days_date(2011,10,27, no_check).get_weekday()==thu);
- BOOST_TEST( days_date(2011,10,28, no_check).get_weekday()==fri);
- BOOST_TEST( days_date(2011,10,29, no_check).get_weekday()==sat);
+ BOOST_TEST( days_date(year(2011),oct,day(23)).get_weekday()==sun);
+ BOOST_TEST( days_date(year(2011),oct,day(24)).get_weekday()==mon);
+ BOOST_TEST( days_date(year(2011),oct,day(25)).get_weekday()==tue);
+ BOOST_TEST( days_date(year(2011),oct,day(26)).get_weekday()==wed);
+ BOOST_TEST( days_date(year(2011),oct,day(27)).get_weekday()==thu);
+ BOOST_TEST( days_date(year(2011),oct,day(28)).get_weekday()==fri);
+ BOOST_TEST( days_date(year(2011),oct,day(29)).get_weekday()==sat);
   }
   // day based arithmetic
   { //+=

Modified: sandbox/chrono_date/libs/date/test/dates/days/nth_days_date_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/dates/days/nth_days_date_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/dates/days/nth_days_date_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -70,7 +70,7 @@
   }
   std::cout <<"***********"<< std::endl;
   { // no_check construct from bad ymd: 2011/oct/22
- rel_date dt(2011,10,22, no_check);
+ rel_date dt(2011,10,22);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
@@ -85,7 +85,7 @@
     BOOST_TEST(dt.get_day()==1);
   }
   { // no_check construct from ymd: 2011/jan_01
- rel_date dt(2011,jan_01, no_check);
+ rel_date dt(2011,jan_01);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
@@ -166,49 +166,49 @@
     BOOST_TEST( dt.is_valid());
   }
   { // conversions to/from system_clock::time_point
- rel_date dt(2011,10,22, no_check);
+ rel_date dt(2011,10,22);
     boost::chrono::system_clock::time_point tp=boost::chrono::system_clock::time_point(dt);
     rel_date dt2(tp);
     BOOST_TEST( dt == dt2);
   }
   // is_leap_year
   {
- rel_date dt(2011,10,22, no_check);
+ rel_date dt(2011,10,22);
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- rel_date dt(0,10,22, no_check);
+ rel_date dt(0,10,22);
     BOOST_TEST( dt.is_leap_year());
   }
   {
- rel_date dt(4,10,22, no_check);
+ rel_date dt(4,10,22);
     BOOST_TEST( dt.is_leap_year());
   }
   {
- rel_date dt(400,10,22, no_check);
+ rel_date dt(400,10,22);
     BOOST_TEST( dt.is_leap_year());
   }
   {
- rel_date dt(100,10,22, no_check);
+ rel_date dt(100,10,22);
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- rel_date dt(200,10,22, no_check);
+ rel_date dt(200,10,22);
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- rel_date dt(300,10,22, no_check);
+ rel_date dt(300,10,22);
     BOOST_TEST( ! dt.is_leap_year());
   }
   // get_weekday
   {
- BOOST_TEST( rel_date(2011,10,23, no_check).get_weekday()==sun);
- BOOST_TEST( rel_date(2011,10,24, no_check).get_weekday()==mon);
- BOOST_TEST( rel_date(2011,10,25, no_check).get_weekday()==tue);
- BOOST_TEST( rel_date(2011,10,26, no_check).get_weekday()==wed);
- BOOST_TEST( rel_date(2011,10,27, no_check).get_weekday()==thu);
- BOOST_TEST( rel_date(2011,10,28, no_check).get_weekday()==fri);
- BOOST_TEST( rel_date(2011,10,29, no_check).get_weekday()==sat);
+ BOOST_TEST( rel_date(2011,10,23).get_weekday()==sun);
+ BOOST_TEST( rel_date(2011,10,24).get_weekday()==mon);
+ BOOST_TEST( rel_date(2011,10,25).get_weekday()==tue);
+ BOOST_TEST( rel_date(2011,10,26).get_weekday()==wed);
+ BOOST_TEST( rel_date(2011,10,27).get_weekday()==thu);
+ BOOST_TEST( rel_date(2011,10,28).get_weekday()==fri);
+ BOOST_TEST( rel_date(2011,10,29).get_weekday()==sat);
   }
   // day based arithmetic
   { //+=

Modified: sandbox/chrono_date/libs/date/test/dates/ydoy/ydoy_date_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/dates/ydoy/ydoy_date_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/dates/ydoy/ydoy_date_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -24,18 +24,18 @@
     BOOST_TEST(dt.days_since_epoch().count()==11979588);
   }
   { // unchecked construct from bad ymd: 0/0/0 results in valid date
- ydoy_date dt(0,0,0,no_check);
+ ydoy_date dt(year(0),month(0),day(0));
     std::cout <<"0/0/0 days "<< dt.days_since_epoch().count() << std::endl;
     BOOST_TEST( ! dt.is_valid());
   }
   { // unchecked construct from bad ymd: 0/0/0 results in valid date
- ydoy_date dt(40000,1,1,no_check);
- BOOST_TEST( ! year(40000,no_check).is_valid());
+ ydoy_date dt(year(40000),month(1),day(1));
+ BOOST_TEST( ! year(40000).is_valid());
     //BOOST_TEST( ! dt.is_valid());
   }
   { // bad construction from bad days: 0
     try {
- ydoy_date dt(days(0));
+ ydoy_date dt(days(0), check);
       BOOST_TEST( false );
     } catch (...) {}
   }
@@ -61,35 +61,35 @@
     BOOST_TEST(dt.get_day()==1);
   }
   { // construct from ymd: 2011/oct/22
- ydoy_date dt(year(2011),oct,day(22));
+ ydoy_date dt(year(2011),oct,day(22), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
     BOOST_TEST(dt.get_day()==22);
   }
   { // no_check construct from bad ymd: 2011/oct/22
- ydoy_date dt(2011,10,22, no_check);
+ ydoy_date dt(year(2011),oct,day(22));
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
     BOOST_TEST(dt.get_day()==22);
   }
   { // construct from ymd: 2011/jan_01
- ydoy_date dt(year(2011),jan_01);
+ ydoy_date dt(year(2011),jan_01, check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
     BOOST_TEST(dt.get_day()==1);
   }
   { // no_check construct from ymd: 2011/jan_01
- ydoy_date dt(2011,jan_01, no_check);
+ ydoy_date dt(year(2011),jan_01);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
     BOOST_TEST(dt.get_day()==1);
   }
   { // construct from ymd: first day: -32768/jan_01
- ydoy_date dt(year(-32768),jan_01);
+ ydoy_date dt(year(-32768),jan_01, check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==-32768);
     BOOST_TEST(dt.get_month()==jan);
@@ -99,7 +99,7 @@
     std::cout <<"-32768/jan/01 days "<< dt.days_since_epoch().count() << std::endl;
   }
   { // construct from ymd: last day: 32767/dec/31
- ydoy_date dt(year(32767),dec,day(31));
+ ydoy_date dt(year(32767),dec,day(31), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==32767);
     BOOST_TEST(dt.get_month()==dec);
@@ -108,7 +108,7 @@
     std::cout <<"32767/12/31 days "<< dt.days_since_epoch().count() << std::endl;
   }
   { // construct from days: first day: -32768/jan_01
- ydoy_date dt(days(11322));
+ ydoy_date dt(days(11322), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==-32768);
     BOOST_TEST(dt.get_month()==jan);
@@ -116,7 +116,7 @@
 
   }
   { // construct from days: last day: 32767/dec/31
- ydoy_date dt(days(23947853));
+ ydoy_date dt(days(23947853), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==32767);
     BOOST_TEST(dt.get_month()==dec);
@@ -125,7 +125,7 @@
 
 
   { // construct from year + doy:
- ydoy_date dt(year(2011), day_of_year(1));
+ ydoy_date dt(year(2011), day_of_year(1), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
@@ -133,7 +133,7 @@
   }
 
   { // construct from year + doy:
- ydoy_date dt(year(2011), day_of_year(365));
+ ydoy_date dt(year(2011), day_of_year(365), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==dec);
@@ -150,7 +150,7 @@
 
   { // construct from bad (year + doy):
     try {
- ydoy_date dt(year(2011), day_of_year(366));
+ ydoy_date dt(year(2011), day_of_year(366), check);
     BOOST_TEST( false );
     } catch (...) {}
   }
@@ -162,49 +162,49 @@
     BOOST_TEST( dt.is_valid());
   }
   { // conversions to/from system_clock::time_point
- ydoy_date dt(2011,10,22, no_check);
+ ydoy_date dt(year(2011),oct,day(22));
     boost::chrono::system_clock::time_point tp=boost::chrono::system_clock::time_point(dt);
     ydoy_date dt2(tp);
     BOOST_TEST( dt == dt2);
   }
   // is_leap_year
   {
- ydoy_date dt(2011,10,22, no_check);
+ ydoy_date dt(year(2011),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- ydoy_date dt(0,10,22, no_check);
+ ydoy_date dt(year(0),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- ydoy_date dt(4,10,22, no_check);
+ ydoy_date dt(year(4),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- ydoy_date dt(400,10,22, no_check);
+ ydoy_date dt(year(400),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- ydoy_date dt(100,10,22, no_check);
+ ydoy_date dt(year(100),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- ydoy_date dt(200,10,22, no_check);
+ ydoy_date dt(year(200),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- ydoy_date dt(300,10,22, no_check);
+ ydoy_date dt(year(300),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   // get_weekday
   {
- BOOST_TEST( ydoy_date(2011,10,23, no_check).get_weekday()==sun);
- BOOST_TEST( ydoy_date(2011,10,24, no_check).get_weekday()==mon);
- BOOST_TEST( ydoy_date(2011,10,25, no_check).get_weekday()==tue);
- BOOST_TEST( ydoy_date(2011,10,26, no_check).get_weekday()==wed);
- BOOST_TEST( ydoy_date(2011,10,27, no_check).get_weekday()==thu);
- BOOST_TEST( ydoy_date(2011,10,28, no_check).get_weekday()==fri);
- BOOST_TEST( ydoy_date(2011,10,29, no_check).get_weekday()==sat);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(23)).get_weekday()==sun);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(24)).get_weekday()==mon);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(25)).get_weekday()==tue);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(26)).get_weekday()==wed);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(27)).get_weekday()==thu);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(28)).get_weekday()==fri);
+ BOOST_TEST( ydoy_date(year(2011),oct,day(29)).get_weekday()==sat);
   }
   // day based arithmetic
   { //+=
@@ -524,8 +524,8 @@
 
 #if 0
   std::cout << jan / day(2) / 2011 << '\n'; // 2011-01-02
- std::cout << month(1, no_check) / day(2) / 2011 << '\n'; // 2011-01-02
- std::cout << ydoy_date(2011, 1, 2, no_check) << '\n'; // 2011-01-02
+ std::cout << month(1) / day(2) / 2011 << '\n'; // 2011-01-02
+ std::cout << ydoy_date(2011, 1, 2) << '\n'; // 2011-01-02
   std::cout << '\n';
 
   std::cout << jan / day(1) / 2011 << '\n'; // 2011-01-02

Modified: sandbox/chrono_date/libs/date/test/dates/ymd/ymd_date_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/dates/ymd/ymd_date_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/dates/ymd/ymd_date_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -26,14 +26,14 @@
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
   { // unchecked construct from bad ymd: 0/0/0 results in valid date
- ymd_date dt(0,0,0,no_check);
+ ymd_date dt(year(0),month(0),day(0));
     std::cout <<"0/0/0 days "<< dt.days_since_epoch().count() << std::endl;
     BOOST_TEST( ! dt.is_valid());
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
   { // unchecked construct from bad ymd: 0/0/0 results in valid date
- ymd_date dt(40000,1,1,no_check);
- BOOST_TEST( ! year(40000,no_check).is_valid());
+ ymd_date dt(year(40000),month(1),day(1));
+ BOOST_TEST( ! year(40000).is_valid());
     //BOOST_TEST( ! dt.is_valid());
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
@@ -42,7 +42,7 @@
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
       days dd(0);
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
- ymd_date dt(days(0));
+ ymd_date dt(days(0), check);
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
       BOOST_TEST( false );
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
@@ -66,14 +66,14 @@
     BOOST_TEST(dt.get_day()==1);
   }
   { // construct from ymd: 2011/oct/22
- ymd_date dt(year(2011),oct,day(22));
+ ymd_date dt(year(2011),oct,day(22), check);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
     BOOST_TEST(dt.get_day()==22);
   }
   { // no_check construct from bad ymd: 2011/oct/22
- ymd_date dt(2011,10,22, no_check);
+ ymd_date dt(year(2011),oct,day(22));
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==oct);
@@ -87,7 +87,7 @@
     BOOST_TEST(dt.get_day()==1);
   }
   { // no_check construct from ymd: 2011/jan_01
- ymd_date dt(2011,jan_01, no_check);
+ ymd_date dt(year(2011),jan_01);
     BOOST_TEST( dt.is_valid());
     BOOST_TEST(dt.get_year()==2011);
     BOOST_TEST(dt.get_month()==jan);
@@ -155,7 +155,7 @@
 
   { // construct from bad (year + doy):
     try {
- ymd_date dt(year(2011), day_of_year(366));
+ ymd_date dt(year(2011), day_of_year(366), check);
     BOOST_TEST( false );
     } catch (...) {}
   }
@@ -167,49 +167,49 @@
     BOOST_TEST( dt.is_valid());
   }
   { // conversions to/from system_clock::time_point
- ymd_date dt(2011,10,22, no_check);
+ ymd_date dt(year(2011),oct,day(22));
     boost::chrono::system_clock::time_point tp=boost::chrono::system_clock::time_point(dt);
     ymd_date dt2(tp);
     BOOST_TEST( dt == dt2);
   }
   // is_leap_year
   {
- ymd_date dt(2011,10,22, no_check);
+ ymd_date dt(year(2011),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- ymd_date dt(0,10,22, no_check);
+ ymd_date dt(year(0),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- ymd_date dt(4,10,22, no_check);
+ ymd_date dt(year(4),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- ymd_date dt(400,10,22, no_check);
+ ymd_date dt(year(400),oct,day(22));
     BOOST_TEST( dt.is_leap_year());
   }
   {
- ymd_date dt(100,10,22, no_check);
+ ymd_date dt(year(100),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- ymd_date dt(200,10,22, no_check);
+ ymd_date dt(year(200),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   {
- ymd_date dt(300,10,22, no_check);
+ ymd_date dt(year(300),oct,day(22));
     BOOST_TEST( ! dt.is_leap_year());
   }
   // get_weekday
   {
- BOOST_TEST( ymd_date(2011,10,23, no_check).get_weekday()==sun);
- BOOST_TEST( ymd_date(2011,10,24, no_check).get_weekday()==mon);
- BOOST_TEST( ymd_date(2011,10,25, no_check).get_weekday()==tue);
- BOOST_TEST( ymd_date(2011,10,26, no_check).get_weekday()==wed);
- BOOST_TEST( ymd_date(2011,10,27, no_check).get_weekday()==thu);
- BOOST_TEST( ymd_date(2011,10,28, no_check).get_weekday()==fri);
- BOOST_TEST( ymd_date(2011,10,29, no_check).get_weekday()==sat);
+ BOOST_TEST( ymd_date(year(2011),oct,day(23)).get_weekday()==sun);
+ BOOST_TEST( ymd_date(year(2011),oct,day(24)).get_weekday()==mon);
+ BOOST_TEST( ymd_date(year(2011),oct,day(25)).get_weekday()==tue);
+ BOOST_TEST( ymd_date(year(2011),oct,day(26)).get_weekday()==wed);
+ BOOST_TEST( ymd_date(year(2011),oct,day(27)).get_weekday()==thu);
+ BOOST_TEST( ymd_date(year(2011),oct,day(28)).get_weekday()==fri);
+ BOOST_TEST( ymd_date(year(2011),oct,day(29)).get_weekday()==sat);
   }
   // day based arithmetic
   { //+=
@@ -525,12 +525,19 @@
     optional<ymd_date> odt = make_optional<ymd_date>(year(2011),nov,day(31));
     BOOST_TEST( ! odt );
   }
+ {
+ ymd_date d1(year(2013), may, day(66));
+ ymd_date d2 = d1 + days(1);
+ std::cout << d2.get_year() << std::endl;
+ std::cout << d2.get_month() << std::endl;
+ std::cout << d2.get_day() << std::endl;
+ }
 
 
 #if 0
   std::cout << jan / day(2) / 2011 << '\n'; // 2011-01-02
- std::cout << month(1, no_check) / day(2) / 2011 << '\n'; // 2011-01-02
- std::cout << ymd_date(2011, 1, 2, no_check) << '\n'; // 2011-01-02
+ std::cout << month(1) / day(2) / 2011 << '\n'; // 2011-01-02
+ std::cout << ymd_date(2011, 1, 2) << '\n'; // 2011-01-02
   std::cout << '\n';
 
   std::cout << jan / day(1) / 2011 << '\n'; // 2011-01-02

Modified: sandbox/chrono_date/libs/date/test/wrappers/day_of_year_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/day_of_year_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/day_of_year_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -13,7 +13,7 @@
   {
     try
     {
- day_of_year doy(0);
+ day_of_year doy(0, check);
       BOOST_TEST(false && "0 is not a valid day of year");
     }
     catch (...)
@@ -23,7 +23,7 @@
   {
     try
     {
- day_of_year doy(367);
+ day_of_year doy(367, check);
       BOOST_TEST(false && "367 is not a valid day of year");
     }
     catch (...)
@@ -31,15 +31,15 @@
     }
   }
   {
- day_of_year doy(0, no_check);
+ day_of_year doy(0);
     BOOST_TEST(!doy.is_valid() && "0 is not a valid day of year");
   }
   {
- day_of_year doy(367, no_check);
+ day_of_year doy(367);
     BOOST_TEST(!doy.is_valid() && "367 is not a valid day of year");
   }
   {
- day_of_year doy(-1, no_check);
+ day_of_year doy(-1);
     BOOST_TEST(!doy.is_valid() && "-1 is not a valid day of year");
   }
   {
@@ -53,13 +53,13 @@
   {
       day_of_year doy(2);
       BOOST_TEST(doy.is_valid() && "2 is a valid day of year");
- day_of_year::rep i = doy;
+ int i = doy;
       BOOST_TEST(i==2);
   }
   {
       day_of_year doy(3);
       BOOST_TEST(doy.is_valid() && "2 is a valid day of year");
- day_of_year::rep i = doy.value();
+ int i = doy.value();
       BOOST_TEST(i==3);
   }
   return boost::report_errors();

Modified: sandbox/chrono_date/libs/date/test/wrappers/day_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/day_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/day_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -13,7 +13,7 @@
   {
     try
     {
- day d(0);
+ day d(0, check);
       BOOST_TEST(false && "0 is not a valid day");
     }
     catch (...)
@@ -23,7 +23,7 @@
   {
     try
     {
- day d(32);
+ day d(32, check);
       BOOST_TEST(false && "32 is not a valid day");
     }
     catch (...)
@@ -31,35 +31,37 @@
     }
   }
   {
- day d(0, no_check);
+ day d(0);
     BOOST_TEST(!d.is_valid() && "0 is not a valid day");
   }
   {
- day d(32, no_check);
+ day d(32);
     BOOST_TEST(!d.is_valid() && "32 is not a valid day");
   }
   {
- day d(-1, no_check);
+ day d(-1);
     BOOST_TEST(!d.is_valid() && "-1 is not a valid day");
   }
   {
       day d(1);
- BOOST_TEST(d.is_valid() && "1 is a valid day");
+ BOOST_TEST(d.is_valid());
+ BOOST_TEST(d==1);
   }
   {
       day d(31);
- BOOST_TEST(d.is_valid() );
+ BOOST_TEST(d.is_valid());
+ BOOST_TEST(d==31);
   }
   {
       day d(2);
- BOOST_TEST(d.is_valid() && "2 is a valid day");
- day::rep i = d;
+ BOOST_TEST(d.is_valid());
+ day::rep i = d; // implicit conversion
       BOOST_TEST(i==2);
   }
   {
       day d(3);
- BOOST_TEST(d.is_valid() && "2 is a valid day");
- day::rep i = d.value();
+ BOOST_TEST(d.is_valid());
+ day::rep i = d.value(); // explicit conversion
       BOOST_TEST(i==3);
   }
   return boost::report_errors();

Modified: sandbox/chrono_date/libs/date/test/wrappers/month_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/month_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/month_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -11,35 +11,35 @@
   using namespace boost::chrono;
 
   {
- try
- {
- month d(0);
- BOOST_TEST(false && "0 is not a valid month");
- }
- catch (...)
- {
- }
- }
- {
- try
- {
- month d(13);
- BOOST_TEST(false && "13 is not a valid month");
- }
- catch (...)
- {
- }
- }
- {
- month d(0, no_check);
- BOOST_TEST(!d.is_valid() && "0 is not a valid month");
- }
+// try
+// {
+// month d(0, check);
+// BOOST_TEST(false && "0 is not a valid month");
+// }
+// catch (...)
+// {
+// }
+ }
+// {
+// try
+// {
+// month d(13, check);
+// BOOST_TEST(false && "13 is not a valid month");
+// }
+// catch (...)
+// {
+// }
+// }
+// {
+// month d(0);
+// BOOST_TEST(!d.is_valid() && "0 is not a valid month");
+// }
   {
- month d(13, no_check);
+ month d(13);
     BOOST_TEST(!d.is_valid() && "13 is not a valid month");
   }
   {
- month d(-1, no_check);
+ month d(-1);
     BOOST_TEST(!d.is_valid() && "-1 is not a valid month");
   }
   {

Modified: sandbox/chrono_date/libs/date/test/wrappers/nth_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/nth_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/nth_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -14,7 +14,7 @@
   {
     try
     {
- nth d(0);
+ nth d(0, check);
       BOOST_TEST(false && "0 is not a valid nth");
     }
     catch (...)
@@ -24,7 +24,7 @@
   {
     try
     {
- nth d(7);
+ nth d(7, check);
       BOOST_TEST(false && "7 is not a valid nth");
     }
     catch (...)
@@ -32,15 +32,15 @@
     }
   }
   {
- nth d(0, no_check);
+ nth d(0);
     BOOST_TEST(!d.is_valid() && "0 is not a valid nth");
   }
   {
- nth d(7, no_check);
+ nth d(7);
     BOOST_TEST(!d.is_valid() && "7 is not a valid nth");
   }
   {
- nth d(-1, no_check);
+ nth d(-1);
     BOOST_TEST(!d.is_valid() && "-1 is not a valid nth");
   }
   {

Modified: sandbox/chrono_date/libs/date/test/wrappers/nth_week_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/nth_week_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/nth_week_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -15,7 +15,7 @@
     try
     {
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
- nth_week d(0);
+ nth_week d(0, check);
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
       BOOST_TEST(false && "0 is not a valid nth_week");
       std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
@@ -29,7 +29,7 @@
   {
     try
     {
- nth_week d(7);
+ nth_week d(7, check);
       BOOST_TEST(false && "7 is not a valid nth_week");
     }
     catch (...)
@@ -38,17 +38,17 @@
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
   {
- nth_week d(0, no_check);
+ nth_week d(0);
     BOOST_TEST(!d.is_valid() && "0 is not a valid nth_week");
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
   {
- nth_week d(7, no_check);
+ nth_week d(7);
     BOOST_TEST(!d.is_valid() && "7 is not a valid nth_week");
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;
   {
- nth_week d(-1, no_check);
+ nth_week d(-1);
     BOOST_TEST(!d.is_valid() && "-1 is not a valid nth_week");
   }
   std::cerr << __FILE__ << ":" << __LINE__ << " " << std::endl;

Modified: sandbox/chrono_date/libs/date/test/wrappers/week_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/week_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/week_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -13,7 +13,7 @@
   {
     try
     {
- week d(0);
+ week d(0, check);
       BOOST_TEST(false && "0 is not a valid week");
     }
     catch (...)
@@ -23,7 +23,7 @@
   {
     try
     {
- week d(54);
+ week d(54, check);
       BOOST_TEST(false && "54 is not a valid week");
     }
     catch (...)
@@ -31,15 +31,15 @@
     }
   }
   {
- week d(0, no_check);
+ week d(0);
     BOOST_TEST(!d.is_valid() && "0 is not a valid week");
   }
   {
- week d(54, no_check);
+ week d(54);
     BOOST_TEST(!d.is_valid() && "54 is not a valid week");
   }
   {
- week d(-1, no_check);
+ week d(-1);
     BOOST_TEST(!d.is_valid() && "-1 is not a valid week");
   }
   {

Modified: sandbox/chrono_date/libs/date/test/wrappers/weekday_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/weekday_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/weekday_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -13,7 +13,7 @@
   {
     try
     {
- weekday d(-1);
+ weekday d(-1, check);
       BOOST_TEST(false && "-1 is not a valid weekday");
     }
     catch (...)
@@ -23,7 +23,7 @@
   {
     try
     {
- weekday d(7);
+ weekday d(7, check);
       BOOST_TEST(false && "7 is not a valid weekday");
     }
     catch (...)
@@ -31,11 +31,11 @@
     }
   }
   {
- weekday d(-1, no_check);
+ weekday d(-1);
     BOOST_TEST(!d.is_valid() && "-1 is not a valid weekday");
   }
   {
- weekday d(7, no_check);
+ weekday d(7);
     BOOST_TEST(!d.is_valid() && "7 is not a valid weekday");
   }
   {

Modified: sandbox/chrono_date/libs/date/test/wrappers/year_pass.cpp
==============================================================================
--- sandbox/chrono_date/libs/date/test/wrappers/year_pass.cpp (original)
+++ sandbox/chrono_date/libs/date/test/wrappers/year_pass.cpp 2013-05-06 07:21:26 EDT (Mon, 06 May 2013)
@@ -11,31 +11,31 @@
   using namespace boost::chrono;
 
   {
- try
- {
- year d(-32769);
- BOOST_TEST(false && "-32769 is not a valid year");
- }
- catch (...)
- {
- }
- }
- {
- try
- {
- year d(32768);
- BOOST_TEST(false && "32768 is not a valid year");
- }
- catch (...)
- {
- }
- }
- {
- year d(-32769, no_check);
- BOOST_TEST(!d.is_valid() && "-32769 is not a valid year");
- }
+// try
+// {
+// year d(-32769, check);
+// BOOST_TEST(false && "-32769 is not a valid year");
+// }
+// catch (...)
+// {
+// }
+ }
+ {
+// try
+// {
+// year d(32768, check);
+// BOOST_TEST(false && "32768 is not a valid year");
+// }
+// catch (...)
+// {
+// }
+ }
+// {
+// year d(-32769);
+// BOOST_TEST(!d.is_valid() && "-32769 is not a valid year");
+// }
   {
- year d(32768, no_check);
+ year d(32768);
     BOOST_TEST(!d.is_valid() && "32768 is not a valid year");
   }
   {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk