Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58245 - in sandbox/chrono: boost boost/chrono libs/chrono/doc libs/chrono/doc/html libs/chrono/doc/html/boost_chrono libs/chrono/doc/html/boost_chrono/appendices libs/chrono/doc/html/boost_chrono/overview libs/chrono/doc/html/boost_chrono/reference libs/chrono/doc/html/boost_chrono/users_guide libs/chrono/test
From: vicente.botet_at_[hidden]
Date: 2009-12-08 16:45:31


Author: viboes
Date: 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
New Revision: 58245
URL: http://svn.boost.org/trac/boost/changeset/58245

Log:
Boost.Chrono: Version 0.2.0, Features + Bug fixes + Updated documentation
* Use INTMAC_C to name intmax_t constants instead of LL.
* result of meta-functions ratio_multiply and ratio_divide were not normalized ratios: Use of the nested ratio typedef type on ratio arithmetic operations. meta-functions ratio_add and ratio_subtract don't nee normalization.
Text files modified:
   sandbox/chrono/boost/chrono/chrono.hpp | 2
   sandbox/chrono/boost/ratio.hpp | 79 +++++++++++++--------------
   sandbox/chrono/libs/chrono/doc/chrono.qbk | 113 ++++++++++++++++++++++++++++++++-------
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html | 18 +++--
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html | 17 -----
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html | 88 +++++++++++++++++++++++++++++-
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html | 4
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html | 1
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html | 68 ++++++++++++------------
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/chrono_hpp.html | 2
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html | 6 +-
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/ext_references.html | 12 +++
   sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html | 33 ++++++-----
   sandbox/chrono/libs/chrono/doc/html/index.html | 7 +
   sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest | 1
   sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp | 10 --
   sandbox/chrono/libs/chrono/test/ratio_test.cpp | 35 +++--------
   17 files changed, 314 insertions(+), 182 deletions(-)

Modified: sandbox/chrono/boost/chrono/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/chrono.hpp 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -82,7 +82,7 @@
 
 #ifdef BOOST_CHRONO_WINDOWS_API
 // The system_clock tick is 100 nanoseconds
-# define BOOST_SYSTEM_CLOCK_DURATION duration<boost::int_least64_t, ratio<1LL, 10000000LL> >
+# define BOOST_SYSTEM_CLOCK_DURATION duration<boost::int_least64_t, ratio<INTMAX_C(1), INTMAX_C(10000000)> >
 #else
 # define BOOST_SYSTEM_CLOCK_DURATION boost::chrono::nanoseconds
 #endif

Modified: sandbox/chrono/boost/ratio.hpp
==============================================================================
--- sandbox/chrono/boost/ratio.hpp (original)
+++ sandbox/chrono/boost/ratio.hpp 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -128,7 +128,7 @@
   class ll_add<X, Y, 1>
   {
       static const boost::intmax_t min =
- (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
+ (INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
       static const boost::intmax_t max = -min;
 
       static char test[X <= max - Y];
@@ -148,7 +148,7 @@
   class ll_add<X, Y, -1>
   {
       static const boost::intmax_t min =
- (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
+ (INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
       static const boost::intmax_t max = -min;
 
       static char test[min - Y <= X];
@@ -164,7 +164,7 @@
   class ll_sub<X, Y, 1>
   {
       static const boost::intmax_t min =
- (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
+ (INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
       static const boost::intmax_t max = -min;
 
       static char test[min + Y <= X];
@@ -184,7 +184,7 @@
   class ll_sub<X, Y, -1>
   {
       static const boost::intmax_t min =
- (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
+ (INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1)) + 1;
       static const boost::intmax_t max = -min;
 
       static char test[X <= max + Y];
@@ -197,7 +197,7 @@
   class ll_mul
   {
       static const boost::intmax_t nan =
- (1LL << (sizeof(boost::intmax_t) * CHAR_BIT - 1));
+ (INTMAX_C(1) << (sizeof(boost::intmax_t) * CHAR_BIT - 1));
       static const boost::intmax_t min = nan + 1;
       static const boost::intmax_t max = -min;
       static const boost::intmax_t a_x = static_abs<X>::value;
@@ -280,7 +280,6 @@
     static const boost::intmax_t num = m_s * m_na / m_gcd;
     static const boost::intmax_t den = m_da / m_gcd;
 
-#if 1
     ratio() {}
         
     template <intmax_t _N2, intmax_t _D2>
@@ -299,7 +298,6 @@
             ratio&
>::type
     operator=(const ratio<_N2, _D2>&) {return *this;}
-#endif
 
     typedef ratio<num, den> type;
 };
@@ -313,19 +311,18 @@
 template <class R1, class R2>
 struct ratio_add
 {
-private:
-#if 1
-#else
- static const boost::intmax_t gcd_n1_n2 = detail::static_gcd<R1::num, R2::num>::value;
- static const boost::intmax_t gcd_d1_d2 = detail::static_gcd<R1::den, R2::den>::value;
-#endif
+#if 0
 public:
- //The nested typedef type shall be a synonym for ratio<T1, T2> where T1 has the value R1::num *
+ //The nested typedef type shall be a synonym for ratio<T1, T2>::type where T1 has the value R1::num *
     //R2::den + R2::num * R1::den and T2 has the value R1::den * R2::den.
-#if 1
     typedef typename ratio<R1::num * R2::den + R2::num * R1::den,R1::den * R2::den>::type type;
- //typedef ratio<aux_type::num ,aux_type::den > type;
+ // The preceding declaration doesn't works because of overflow on intmax_t.
 #else
+private:
+ static const boost::intmax_t gcd_n1_n2 = detail::static_gcd<R1::num, R2::num>::value;
+ static const boost::intmax_t gcd_d1_d2 = detail::static_gcd<R1::den, R2::den>::value;
+public:
+ // No need to normalize as ratio_multiply is already normalized
     typedef typename ratio_multiply
        <
            ratio<gcd_n1_n2, R1::den / gcd_d1_d2>,
@@ -345,19 +342,18 @@
 template <class R1, class R2>
 struct ratio_subtract
 {
-private:
-#if 1
+#if 0
+public:
+ //The nested typedef type shall be a synonym for ratio<T1, T2>::type where T1 has the value
+ // R1::num *R2::den - R2::num * R1::den and T2 has the value R1::den * R2::den.
+ typedef typename ratio<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type type;
+ // The preceding declaration doesn't works because of overflow on intmax_t.
 #else
+private:
     static const boost::intmax_t gcd_n1_n2 = detail::static_gcd<R1::num, R2::num>::value;
     static const boost::intmax_t gcd_d1_d2 = detail::static_gcd<R1::den, R2::den>::value;
-#endif
 public:
-//The nested typedef type shall be a synonym for ratio<T1, T2> where T1 has the value
-// R1::num *R2::den - R2::num * R1::den and T2 has the value R1::den * R2::den.
-#if 1
- typedef typename ratio<R1::num * R2::den - R2::num * R1::den,R1::den * R2::den>::type type;
- //typedef ratio<aux_type::num ,aux_type::den > type;
-#else
+ // No need to normalize as ratio_multiply is already normalized
     typedef typename ratio_multiply
        <
            ratio<gcd_n1_n2, R1::den / gcd_d1_d2>,
@@ -377,40 +373,41 @@
 template <class R1, class R2>
 struct ratio_multiply
 {
+#if 0
+public:
+ // The nested typedef type shall be a synonym for ratio<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type.
+ typedef typename ratio<R1::num * R2::num, R1::den * R2::den>::type type;
+ // The preceding declaration doesn't works because of overflow on intmax_t.
+#else
 private:
-#if 0
    static const boost::intmax_t gcd_n1_d2 = detail::static_gcd<R1::num, R2::den>::value;
    static const boost::intmax_t gcd_d1_n2 = detail::static_gcd<R1::den, R2::num>::value;
-#endif
 public:
-#if 0
- typedef ratio
+ typedef typename ratio
        <
            detail::ll_mul<R1::num / gcd_n1_d2, R2::num / gcd_d1_n2>::value,
            detail::ll_mul<R2::den / gcd_n1_d2, R1::den / gcd_d1_n2>::value
- > type;
-#else
- typedef typename ratio<R1::num * R2::num, R1::den * R2::den>::type type;
+ >::type type;
 #endif
 };
 
 template <class R1, class R2>
 struct ratio_divide
 {
+#if 0
+public:
+ // The nested typedef type shall be a synonym for ratio<R1::num * R2::den, R2::num * R1::den>::type.
+ typedef typename ratio<R1::num * R2::den, R1::den * R2::num>::type type;
+#else
 private:
-#if 0
- static const boost::intmax_t gcd_n1_n2 = detail::static_gcd<R1::num, R2::num>::value;
- static const boost::intmax_t gcd_d1_d2 = detail::static_gcd<R1::den, R2::den>::value;
-#endif
+ static const boost::intmax_t gcd_n1_n2 = detail::static_gcd<R1::num, R2::num>::value;
+ static const boost::intmax_t gcd_d1_d2 = detail::static_gcd<R1::den, R2::den>::value;
 public:
-#if 0
- typedef ratio
+ typedef typename ratio
        <
            detail::ll_mul<R1::num / gcd_n1_n2, R2::den / gcd_d1_d2>::value,
            detail::ll_mul<R2::num / gcd_n1_n2, R1::den / gcd_d1_d2>::value
- > type;
-#else
- typedef typename ratio<R1::num * R2::den, R1::den * R2::num>::type type;
+ >::type type;
 #endif
 };
 

Modified: sandbox/chrono/libs/chrono/doc/chrono.qbk
==============================================================================
--- sandbox/chrono/libs/chrono/doc/chrono.qbk (original)
+++ sandbox/chrono/libs/chrono/doc/chrono.qbk 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -94,7 +94,7 @@
 [section Motivation]
 [/=================]
 
-See [@http://www.open-std.org/jtc1/sc22/wg21 [*N2661 - A Foundation to Sleep On]] which is very informative and provides motivation for key design decisions for `common_type`, `ratio` and `chrono`. The following sections are an extract from this document.
+See [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]] which is very informative and provides motivation for key design decisions for `common_type`, `ratio` and `chrono`. The following sections are an extract from this document.
 
 [section Common type]
 
@@ -166,7 +166,7 @@
 
 The only context in which these different types differ is when being converted to one another. At this time, unit-specific compile-time conversion constants are used to convert the source unit to the target unit. Only conversions from coarser units to finer units are allowed (in boost). This restriction ensures that all conversions are always exact. That is, microseconds can always represent any value minutes has.
 
-In Boost.DateTime, these units are united via inheritance. Boost.Chrono instead unites these units through the class template `duration`. That is, in Boost.Chrono all six of the above units are nothing but typedefs to different instantiations of `duration`. This change from Boost.DateTime has a far reaching positive impact, while not changing the syntax of the everyday use at all.
+In Boost.DateTime, these units are united via inheritance. __Boost_Chrono__ instead unites these units through the class template `duration`. That is, in __Boost_Chrono__ all six of the above units are nothing but typedefs to different instantiations of `duration`. This change from Boost.DateTime has a far reaching positive impact, while not changing the syntax of the everyday use at all.
 
 The most immediate positive impact is that the library can immediately generate any unit, any precision it needs. This is sometimes necessary when doing comparisons or arithmetic between `duration`s of differing precision, assuming one wants the comparison and arithmetic to be exactly correct.
 
@@ -174,7 +174,7 @@
 
 In Boost.DateTime, hours does not have the same representation as nanoseconds. The former is usually represented with a long whereas a long long is required for the latter. The reason for this is simply range. You don't need many hours to cover an extremely large range of time. But this isn't true of nanoseconds. Being able to reduce the sizeof overhead for some units when possible, can be a significant performance advantage.
 
-Boost.Chrono continues, and generalizes that philosophy. Not only can one specify the precision of a `duration`, one can also specify its representation. This can be any integral type, or even a floating point type. Or it can be a user-defined type which emulates an arithmetic type. The six predefined units all use signed integral types as their representation. And they all have a minimum range of +/- 292 years. nanoseconds needs 64 bits to cover that range. hours needs only 23 bits to cover that range.
+__Boost_Chrono__ continues, and generalizes that philosophy. Not only can one specify the precision of a `duration`, one can also specify its representation. This can be any integral type, or even a floating point type. Or it can be a user-defined type which emulates an arithmetic type. The six predefined units all use signed integral types as their representation. And they all have a minimum range of +/- 292 years. nanoseconds needs 64 bits to cover that range. hours needs only 23 bits to cover that range.
 
 [heading So What Exactly is a `duration` and How Do I Use One?]
 
@@ -306,7 +306,7 @@
 # A concrete `time_point` type.
 # A function called now() which returns the concrete `time_point`.
 
-Boost.Chrono proposes 3 concrete clocks:
+__Boost_Chrono__ proposes 3 concrete clocks:
 
 # system_clock
 # monotonic_clock
@@ -353,7 +353,7 @@
 
 In each of the examples above, a different epoch is implied. Sometimes an epoch has meaning for several millennia. Other times the meaning of an epoch is lost after a while (such as the start of a timer, or when the computer booted). However, if two `time_point`s are known to share the same epoch, they can be subtracted, yielding a valid `duration`, even if the definition of the epoch no longer has meaning.
 
-In Boost.Chrono, an epoch is a purely abstract and unspecified concept. There is no type representing an epoch. It is simply an idea that relates (or doesn't) `time_point`s to a clock, and in the case that they share a clock, `time_point`s to one another. `time_point`s associated with different clocks are generally not interoperable unless the relationship between the epochs associated with each clock is known.
+In __Boost_Chrono__, an epoch is a purely abstract and unspecified concept. There is no type representing an epoch. It is simply an idea that relates (or doesn't) `time_point`s to a clock, and in the case that they share a clock, `time_point`s to one another. `time_point`s associated with different clocks are generally not interoperable unless the relationship between the epochs associated with each clock is known.
 
 [heading So What Exactly is a `time_point` and How Do I Use One?]
 
@@ -407,6 +407,12 @@
 
 
 [endsect]
+
+[section Caveat emptor]
+
+The underlying clocks provided by operating systems are subject to many seemingly arbitrary policies and implementation irregularities. That's a polite way of saying they tend to be flakey, and each operating system or even each clock has its own cruel and unusual forms of flakiness. Don't bet the farm on their accuracy, unless you have become deeply familiar with exactly what the specific operating system is guaranteeing, which is often very little.
+
+[endsect]
 [endsect]
 
 
@@ -423,19 +429,19 @@
 [/======================================]
 
 [/=================================]
-[heading Getting Boost.Chrono]
+[heading Getting __Boost_Chrono__]
 [/=================================]
 
-You can get the last stable release of Boost.Chrono by downloading [^chrono.zip] from the
+You can get the last stable release of __Boost_Chrono__ by downloading [^chrono.zip] from the
 [@http://www.boost-consulting.com/vault/index.php?directory=System Boost Vault]
 
 You can also access the latest (unstable?) state from the [@https://svn.boost.org/svn/boost/sandbox/chrono Boost Sandbox].
 
 [/=================================]
-[heading Building Boost.Chrono]
+[heading Building __Boost_Chrono__]
 [/=================================]
 
-__Boost_Chono__ is not a header only library. You need to compile it before use.
+__Boost_Chrono__ is not a header only library. You need to compile it before use.
 
     bjam libs/chrono/build
 
@@ -446,7 +452,7 @@
 
 [*Boost.Bitfield] depends on some Boost libraries. For these specific parts you must use either Boost version 1.39.0 or the version in SVN trunk (even if older version should works also).
 
-In particular, Boost.Chrono depends on:
+In particular, __Boost_Chrono__ depends on:
 
 [variablelist
 [
@@ -563,10 +569,21 @@
 ]
 
 [
- [[@http://www.open-std.org/jtc1/sc22/wg21 [*N2661 - A Foundation to Sleep On]]]
+ [[@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]]]
     [From Howard E. Hinnant, Walter E. Brown, Jeff Garland and Marc Paterno. Is very informative and provides motivation for key design decisions]
 ]
 
+
+[
+ [[@http://home.roadrunner.com/~hinnant/issue_review/lwg-defects.html#934 [*LGW 934. duration is missing operator%]]]
+ [From Terry Golubiewski. Is very informative and provides motivation for key design decisions]
+]
+
+[
+ [[@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281 [*LWG 1281. CopyConstruction and Assignment between ratios having the same normalized form]]]
+ [From Vicente Juan Botet Escriba.]
+]
+
 ]
 
 [endsect]
@@ -2001,18 +2018,19 @@
 
 [section [*Version 0.2.0, December 8, 2009] ['+ Features + Bug fixes + Updated documentation]]
 
-[*Features:]
+[*Features:]
 
-* Added ratio construction and assignment from an equivalent ratio.
-* Added nested ratio typedef type.
+* Added ratio construction and assignment from an equivalent ratio ([@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281 [*LWG 1281. CopyConstruction and Assignment between ratios having the same normalized form]])
+* Added nested ratio typedef type ([@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281 [*LWG 1281. CopyConstruction and Assignment between ratios having the same normalized form]])
 * Added BOOST_CHRONO_HAS_CLOCK_MONOTONIC macro to state if monotonic_clock is provided on this platform.
-* Added duration operator%
+* Added duration operator% ([@http://home.roadrunner.com/~hinnant/issue_review/lwg-defects.html#934 [*934. duration is missing operator%]])
 * Added BOOST_CONSTEXPR when constexpr should be used
 * Complete duration operator* and operator/
 
 
 [*Implementation:]
 
+* Use INTMAC_C to name intmax_t constants instead of LL.
 * Separate chrono.cpp on # files win/chrono.cpp, mac/chrono.cpp and posix/chrono.cpp to make easier the maintenance on different platforms.
 * Separate process_clock.cpp on # files win/process_clock.cpp, mac/process_clock.cpp and posix/process_clock.cpp to make easir the maintenace on different platforms.
 * Added the error_code prototype for monotonic_clock::now for mac/chono.cpp
@@ -2021,13 +2039,13 @@
 
 [*Documentation:]
 
-* The documentation is written now using quick-book using as base [@http://www.open-std.org/jtc1/sc22/wg21 [*N2661 - A Foundation to Sleep On]] .
+* The documentation is written now using quick-book using as base [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]] .
 
 [*Bugs]
 
 * operator/ was ambiguous: Disambiguate duration operator/
 * CLOCK_MONOTONIC is not defined with cygwin/gcc 3.4: Disable code when BOOST_CHRONO_HAS_CLOCK_MONOTONIC is not defined.
-* result of metafunctions ratio_add and ratio_sub were not normalized ratios: Use of the nested ratio typedef type on ratio arithmetic operations.
+* result of metafunctions ratio_multiply and ratio_divide were not normalized ratios: Use of the nested ratio typedef type on ratio arithmetic operations.
 * Copy constructor from similar duration masked the defaulted operations: Added duration defaulted implementations
 
 
@@ -2061,22 +2079,73 @@
 
 [section:rationale Appendix B: Rationale]
 
-See [http://www.open-std.org/jtc1/sc22/wg21 [*N2661 - A Foundation to Sleep On]] which is very informative and provides motivation for key design decisions. The following sections are an extract from this document.
+See [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm [*N2661 - A Foundation to Sleep On]] which is very informative and provides motivation for key design decisions. The following sections are an extract from this document.
 
 [heading Is it possible for the user to pass a `duration` to a function with the units being ambiguous?]
 
 No. No matter which option the author of `f` chooses above, the following client code will not compile:
 
     f(3); // Will not compile, 3 is not implicitly convertible to any `duration`
-
+
+[heading Why duration needs operator%]
+
+This operator is convenient for computing where in a time frame a given duration lies. A motivating example is converting a duration into a "broken-down" time duration such as hours::minutes::seconds:
+
+ class ClockTime
+ {
+ typedef std::chrono::hours hours;
+ typedef std::chrono::minutes minutes;
+ typedef std::chrono::seconds seconds;
+ public:
+ hours hours_;
+ minutes minutes_;
+ seconds seconds_;
+
+ template <class Rep, class Period>
+ explicit ClockTime(const std::chrono::duration<Rep, Period>& d)
+ : hours_ (std::chrono::duration_cast<hours> (d)),
+ minutes_(std::chrono::duration_cast<minutes>(d % hours(1))),
+ seconds_(std::chrono::duration_cast<seconds>(d % minutes(1)))
+ {}
+ };
+
+[heading Why ratio needs CopyConstruction and Assignment from ratios having the same normalized form]
+
+Current [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf [*N3000]] doesn't allows to copy-construct or assign ratio instances of ratio classes having the same normalized form.
+
+This simple example
+
+ ratio<1,3> r1;
+ ratio<3,9> r2;
+ r1 = r2; // (1)
+
+fails to compile in (1). Other example
+
+ ratio<1,3> r1;
+ ratio<2,3> r2;
+ r1 = r2-r1; // (2)
+
+The type of this expression (r2-r1) could be ratio<3,9> so the compilation could fail in (2). It could also be ratio<1,3> and the compilation succeeds.
+
+[heading Why ratio needs the nested normalizer typedef type]
+
+In [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3000.pdf [*N3000]] 20.4.2 and similar clauses
+
+[/3 The nested typedef type shall be a synonym for ratio<T1, T2> where T1 has the value R1::num * R2::den - R2::num * R1::den and T2 has the value R1::den * R2::den.]
+
+The meaning of synonym let think that the result shall be a normalized ratio equivalent to ratio<T1, T2>, but there is not an explicit definition of what synonym means in this context.
+
+If the CopyConstruction and Assignment ([[@http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#12811281 [*LWG 1281]]) is not added we need a typedef for accessing the normalized ratio, and change 20.4.2 to return only this normalized result. In this case the user will need to
+
+ ratio<1,3>::type r1;
+ ratio<3,9>::type r2;
+ r1 = r2; // compiles as both types are the same.
+
 
 [endsect]
 
 [section:implementation Appendix C: Implementation Notes]
 
-[heading Caveat emptor]
-
-The underlying clocks provided by operating systems are subject to many seemingly arbitrary policies and implementation irregularities. That's a polite way of saying they tend to be flakey, and each operating system or even each clock has its own cruel and unusual forms of flakiness. Don't bet the farm on their accuracy, unless you have become deeply familiar with exactly what the specific operating system is guaranteeing, which is often very little.
 
 [heading Why does run_timer only display millisecond place precision when the underlying timer has nanosecond precision?]
 

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -43,17 +43,19 @@
         </p>
 <div class="itemizedlist"><ul type="disc">
 <li>
- Added ratio construction and assignment from an equivalent ratio.
+ Added ratio construction and assignment from an equivalent ratio (<a href="http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281" target="_top"><span class="bold"><strong>LWG 1281. CopyConstruction and Assignment between ratios
+ having the same normalized form</strong></span></a>)
           </li>
 <li>
- Added nested ratio typedef type.
+ Added nested ratio typedef type (<a href="http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281" target="_top"><span class="bold"><strong>LWG 1281. CopyConstruction and Assignment between ratios
+ having the same normalized form</strong></span></a>)
           </li>
 <li>
             Added BOOST_CHRONO_HAS_CLOCK_MONOTONIC macro to state if monotonic_clock
             is provided on this platform.
           </li>
 <li>
- Added duration operator%
+ Added duration operator% (934. duration is missing operator%)
           </li>
 <li>
             Added BOOST_CONSTEXPR when constexpr should be used
@@ -67,6 +69,9 @@
         </p>
 <div class="itemizedlist"><ul type="disc">
 <li>
+ Use INTMAC_C to name intmax_t constants instead of LL.
+ </li>
+<li>
             Separate chrono.cpp on # files win/chrono.cpp, mac/chrono.cpp and posix/chrono.cpp
             to make easier the maintenance on different platforms.
           </li>
@@ -89,8 +94,7 @@
           <span class="bold"><strong>Documentation:</strong></span>
         </p>
 <div class="itemizedlist"><ul type="disc"><li>
- The documentation is written now using quick-book using as base <a href="http://www.open-std.org/jtc1/sc22/wg21" target="_top"><span class="bold"><strong>N2661
- - A Foundation to Sleep On</strong></span></a> .
+ The documentation is written now using quick-book using as base N2661 - A Foundation to Sleep On .
           </li></ul></div>
 <p>
           <span class="bold"><strong>Bugs</strong></span>
@@ -104,8 +108,8 @@
             BOOST_CHRONO_HAS_CLOCK_MONOTONIC is not defined.
           </li>
 <li>
- result of metafunctions ratio_add and ratio_sub were not normalized ratios:
- Use of the nested ratio typedef type on ratio arithmetic operations.
+ result of metafunctions ratio_multiply and ratio_divide were not normalized
+ ratios: Use of the nested ratio typedef type on ratio arithmetic operations.
           </li>
 <li>
             Copy constructor from similar duration masked the defaulted operations:

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/implementation.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -30,21 +30,8 @@
       Implementation Notes"> Appendix C:
       Implementation Notes</a>
 </h3></div></div></div>
-<a name="boost_chrono.appendices.implementation.caveat_emptor"></a><h4>
-<a name="id4853495"></a>
- <a href="implementation.html#boost_chrono.appendices.implementation.caveat_emptor">Caveat
- emptor</a>
- </h4>
-<p>
- The underlying clocks provided by operating systems are subject to many seemingly
- arbitrary policies and implementation irregularities. That's a polite way
- of saying they tend to be flakey, and each operating system or even each
- clock has its own cruel and unusual forms of flakiness. Don't bet the farm
- on their accuracy, unless you have become deeply familiar with exactly what
- the specific operating system is guaranteeing, which is often very little.
- </p>
 <a name="boost_chrono.appendices.implementation.why_does_run_timer_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_"></a><h4>
-<a name="id4853528"></a>
+<a name="id4854709"></a>
         <a href="implementation.html#boost_chrono.appendices.implementation.why_does_run_timer_only_display_millisecond_place_precision_when_the_underlying_timer_has_nanosecond_precision_">Why
         does run_timer only display millisecond place precision when the underlying
         timer has nanosecond precision?</a>
@@ -55,7 +42,7 @@
         dangerously.
       </p>
 <a name="boost_chrono.appendices.implementation.why_does_run_timer_sometimes_report_more_cpu_seconds_than_real_seconds_"></a><h4>
-<a name="id4853569"></a>
+<a name="id4854749"></a>
         <a href="implementation.html#boost_chrono.appendices.implementation.why_does_run_timer_sometimes_report_more_cpu_seconds_than_real_seconds_">Why
         does run_timer sometimes report more cpu seconds than real seconds?</a>
       </h4>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -28,13 +28,12 @@
 <a name="boost_chrono.appendices.rationale"></a> Appendix B: Rationale
 </h3></div></div></div>
 <p>
- See [http://www.open-std.org/jtc1/sc22/wg21 <span class="bold"><strong>N2661 -
- A Foundation to Sleep On</strong></span>] which is very informative and provides
- motivation for key design decisions. The following sections are an extract
- from this document.
+ See [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2661.htm <span class="bold"><strong>N2661 - A Foundation to Sleep On</strong></span>] which is very informative
+ and provides motivation for key design decisions. The following sections
+ are an extract from this document.
       </p>
 <a name="boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a__code__phrase_role__identifier__duration__phrase___code__to_a_function_with_the_units_being_ambiguous_"></a><h4>
-<a name="id4853388"></a>
+<a name="id4853554"></a>
         <a href="rationale.html#boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a__code__phrase_role__identifier__duration__phrase___code__to_a_function_with_the_units_being_ambiguous_">Is
         it possible for the user to pass a <code class="computeroutput"><span class="identifier">duration</span></code>
         to a function with the units being ambiguous?</a>
@@ -45,6 +44,85 @@
       </p>
 <pre class="programlisting"><span class="identifier">f</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// Will not compile, 3 is not implicitly convertible to any `duration`
 </span></pre>
+<a name="boost_chrono.appendices.rationale.why_duration_needs_operator_"></a><h4>
+<a name="id4853644"></a>
+ <a href="rationale.html#boost_chrono.appendices.rationale.why_duration_needs_operator_">Why
+ duration needs operator%</a>
+ </h4>
+<p>
+ This operator is convenient for computing where in a time frame a given duration
+ lies. A motivating example is converting a duration into a "broken-down"
+ time duration such as hours::minutes::seconds:
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">ClockTime</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">hours</span> <span class="identifier">hours</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">minutes</span> <span class="identifier">minutes</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">seconds</span> <span class="identifier">seconds</span><span class="special">;</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">hours</span> <span class="identifier">hours_</span><span class="special">;</span>
+ <span class="identifier">minutes</span> <span class="identifier">minutes_</span><span class="special">;</span>
+ <span class="identifier">seconds</span> <span class="identifier">seconds_</span><span class="special">;</span>
+
+ <span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">&gt;</span>
+ <span class="keyword">explicit</span> <span class="identifier">ClockTime</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special">&lt;</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">&gt;&amp;</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">hours_</span> <span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special">&lt;</span><span class="identifier">hours</span><span class="special">&gt;</span> <span class="special">(</span><span class="identifier">d</span><span class="special">)),</span>
+ <span class="identifier">minutes_</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special">&lt;</span><span class="identifier">minutes</span><span class="special">&gt;(</span><span class="identifier">d</span> <span class="special">%</span> <span class="identifier">hours</span><span class="special">(</span><span class="number">1</span><span class="special">))),</span>
+ <span class="identifier">seconds_</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special">&lt;</span><span class="identifier">seconds</span><span class="special">&gt;(</span><span class="identifier">d</span> <span class="special">%</span> <span class="identifier">minutes</span><span class="special">(</span><span class="number">1</span><span class="special">)))</span>
+ <span class="special">{}</span>
+<span class="special">};</span>
+</pre>
+<a name="boost_chrono.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form"></a><h4>
+<a name="id4854223"></a>
+ <a href="rationale.html#boost_chrono.appendices.rationale.why_ratio_needs_copyconstruction_and_assignment_from_ratios_having_the_same_normalized_form">Why
+ ratio needs CopyConstruction and Assignment from ratios having the same normalized
+ form</a>
+ </h4>
+<p>
+ Current N3000 doesn't allows to copy-construct or
+ assign ratio instances of ratio classes having the same normalized form.
+ </p>
+<p>
+ This simple example
+ </p>
+<pre class="programlisting"><span class="identifier">ratio</span><span class="special">&lt;</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">&gt;</span> <span class="identifier">r1</span><span class="special">;</span>
+<span class="identifier">ratio</span><span class="special">&lt;</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">&gt;</span> <span class="identifier">r2</span><span class="special">;</span>
+<span class="identifier">r1</span> <span class="special">=</span> <span class="identifier">r2</span><span class="special">;</span> <span class="comment">// (1)
+</span></pre>
+<p>
+ fails to compile in (1). Other example
+ </p>
+<pre class="programlisting"><span class="identifier">ratio</span><span class="special">&lt;</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">&gt;</span> <span class="identifier">r1</span><span class="special">;</span>
+<span class="identifier">ratio</span><span class="special">&lt;</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">&gt;</span> <span class="identifier">r2</span><span class="special">;</span>
+<span class="identifier">r1</span> <span class="special">=</span> <span class="identifier">r2</span><span class="special">-</span><span class="identifier">r1</span><span class="special">;</span> <span class="comment">// (2)
+</span></pre>
+<p>
+ The type of this expression (r2-r1) could be ratio&lt;3,9&gt; so the compilation
+ could fail in (2). It could also be ratio&lt;1,3&gt; and the compilation
+ succeeds.
+ </p>
+<a name="boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
+<a name="id4854512"></a>
+ <a href="rationale.html#boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type">Why
+ ratio needs the nested normalizer typedef type</a>
+ </h4>
+<p>
+ In N3000 20.4.2 and similar clauses
+ </p>
+<p>
+ The meaning of synonym let think that the result shall be a normalized ratio
+ equivalent to ratio&lt;T1, T2&gt;, but there is not an explicit definition
+ of what synonym means in this context.
+ </p>
+<p>
+ If the CopyConstruction and Assignment ([LWG 1281) is not added we need a typedef for
+ accessing the normalized ratio, and change 20.4.2 to return only this normalized
+ result. In this case the user will need to
+ </p>
+<pre class="programlisting"><span class="identifier">ratio</span><span class="special">&lt;</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">r1</span><span class="special">;</span>
+<span class="identifier">ratio</span><span class="special">&lt;</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">&gt;::</span><span class="identifier">type</span> <span class="identifier">r2</span><span class="special">;</span>
+<span class="identifier">r1</span> <span class="special">=</span> <span class="identifier">r2</span><span class="special">;</span> <span class="comment">// compiles as both types are the same.
+</span></pre>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
 <td align="left"></td>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -27,7 +27,7 @@
 <a name="boost_chrono.appendices.todo"></a> Appendix F: Future plans
 </h3></div></div></div>
 <a name="boost_chrono.appendices.todo.tasks_to_do_before_review"></a><h4>
-<a name="id4854159"></a>
+<a name="id4855339"></a>
         <a href="todo.html#boost_chrono.appendices.todo.tasks_to_do_before_review">Tasks
         to do before review</a>
       </h4>
@@ -61,7 +61,7 @@
     &gt; high resolution timers to avoid these issues.
       </p>
 <a name="boost_chrono.appendices.todo.for_later_releases"></a><h4>
-<a name="id4854218"></a>
+<a name="id4855398"></a>
         <a href="todo.html#boost_chrono.appendices.todo.for_later_releases">For later
         releases</a>
       </h4>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -37,6 +37,7 @@
 <dt><span class="section">Time Point</span></dt>
 <dt><span class="section">Timers</span></dt>
 </dl></dd>
+<dt><span class="section">Caveat emptor</span></dt>
 </dl></div>
 <a name="boost_chrono.overview.description"></a><h3>
 <a name="id4762284"></a>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -7,7 +7,7 @@
 <link rel="start" href="../../index.html" title="Boost.Chrono">
 <link rel="up" href="../overview.html" title="Overview">
 <link rel="prev" href="../overview.html" title="Overview">
-<link rel="next" href="../users_guide.html" title=" Users'Guide">
+<link rel="next" href="caveat_emptor.html" title="Caveat emptor">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table cellpadding="2" width="100%"><tr>
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="../overview.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../users_guide.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../overview.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="caveat_emptor.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h3 class="title">
@@ -36,11 +36,10 @@
 <dt><span class="section">Timers</span></dt>
 </dl></div>
 <p>
- See <a href="http://www.open-std.org/jtc1/sc22/wg21" target="_top"><span class="bold"><strong>N2661
- - A Foundation to Sleep On</strong></span></a> which is very informative and
- provides motivation for key design decisions for <code class="computeroutput"><span class="identifier">common_type</span></code>,
- <code class="computeroutput"><span class="identifier">ratio</span></code> and <code class="computeroutput"><span class="identifier">chrono</span></code>.
- The following sections are an extract from this document.
+ See N2661 - A Foundation to Sleep On which is
+ very informative and provides motivation for key design decisions for <code class="computeroutput"><span class="identifier">common_type</span></code>, <code class="computeroutput"><span class="identifier">ratio</span></code>
+ and <code class="computeroutput"><span class="identifier">chrono</span></code>. The following
+ sections are an extract from this document.
       </p>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h4 class="title">
@@ -198,12 +197,13 @@
           always represent any value minutes has.
         </p>
 <p>
- In Boost.DateTime, these units are united via inheritance. Boost.Chrono
- instead unites these units through the class template <code class="computeroutput"><span class="identifier">duration</span></code>.
- That is, in Boost.Chrono all six of the above units are nothing but typedefs
- to different instantiations of <code class="computeroutput"><span class="identifier">duration</span></code>.
- This change from Boost.DateTime has a far reaching positive impact, while
- not changing the syntax of the everyday use at all.
+ In Boost.DateTime, these units are united via inheritance. __Boost<span class="underline">Chrono</span>_ instead unites these units through
+ the class template <code class="computeroutput"><span class="identifier">duration</span></code>.
+ That is, in __Boost<span class="underline">Chrono</span>_ all six
+ of the above units are nothing but typedefs to different instantiations
+ of <code class="computeroutput"><span class="identifier">duration</span></code>. This change
+ from Boost.DateTime has a far reaching positive impact, while not changing
+ the syntax of the everyday use at all.
         </p>
 <p>
           The most immediate positive impact is that the library can immediately
@@ -231,17 +231,16 @@
           possible, can be a significant performance advantage.
         </p>
 <p>
- Boost.Chrono continues, and generalizes that philosophy. Not only can one
- specify the precision of a <code class="computeroutput"><span class="identifier">duration</span></code>,
- one can also specify its representation. This can be any integral type,
- or even a floating point type. Or it can be a user-defined type which emulates
- an arithmetic type. The six predefined units all use signed integral types
- as their representation. And they all have a minimum range of +/- 292 years.
- nanoseconds needs 64 bits to cover that range. hours needs only 23 bits
- to cover that range.
+ __Boost<span class="underline">Chrono</span>_ continues, and generalizes
+ that philosophy. Not only can one specify the precision of a <code class="computeroutput"><span class="identifier">duration</span></code>, one can also specify its representation.
+ This can be any integral type, or even a floating point type. Or it can
+ be a user-defined type which emulates an arithmetic type. The six predefined
+ units all use signed integral types as their representation. And they all
+ have a minimum range of +/- 292 years. nanoseconds needs 64 bits to cover
+ that range. hours needs only 23 bits to cover that range.
         </p>
 <a name="boost_chrono.overview.motivation.duration.so_what_exactly_is_a__code__phrase_role__identifier__duration__phrase___code__and_how_do_i_use_one_"></a><h5>
-<a name="id4759304"></a>
+<a name="id4759064"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.so_what_exactly_is_a__code__phrase_role__identifier__duration__phrase___code__and_how_do_i_use_one_">So
           What Exactly is a <code class="computeroutput"><span class="identifier">duration</span></code>
           and How Do I Use One?</a>
@@ -299,7 +298,7 @@
           instead of inheritance).
         </p>
 <a name="boost_chrono.overview.motivation.duration.what_happens_if_i_assign__code__phrase_role__identifier__m3__phrase___phrase_role__special_____phrase___phrase_role__identifier__us3__phrase___code__to_minutes_instead_of_microseconds_"></a><h5>
-<a name="id4758210"></a>
+<a name="id4759770"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.what_happens_if_i_assign__code__phrase_role__identifier__m3__phrase___phrase_role__special_____phrase___phrase_role__identifier__us3__phrase___code__to_minutes_instead_of_microseconds_">What
           happens if I assign <code class="computeroutput"><span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span></code>
           to minutes instead of microseconds?</a>
@@ -315,7 +314,7 @@
           ignored. This is similar to the problem of assigning a double to an <code class="computeroutput"><span class="keyword">int</span></code>: the fractional part gets silently discarded.
         </p>
 <a name="boost_chrono.overview.motivation.duration.but_what_if_the_truncation_behavior_is_what_i_want_to_do_"></a><h5>
-<a name="id4813041"></a>
+<a name="id4759923"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.but_what_if_the_truncation_behavior_is_what_i_want_to_do_">But
           what if the truncation behavior is what I want to do?</a>
         </h5>
@@ -335,7 +334,7 @@
           as often as it can.
         </p>
 <a name="boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point__code__phrase_role__identifier__duration__phrase___code_s__i_don_t_want_to_deal_with_writing__code__phrase_role__identifier__duration_cast__phrase___code__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation"></a><h5>
-<a name="id4813177"></a>
+<a name="id4813064"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point__code__phrase_role__identifier__duration__phrase___code_s__i_don_t_want_to_deal_with_writing__code__phrase_role__identifier__duration_cast__phrase___code__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation">I'm
           trafficking in floating point <code class="computeroutput"><span class="identifier">duration</span></code>s.
           I don't want to deal with writing <code class="computeroutput"><span class="identifier">duration_cast</span></code>
@@ -350,7 +349,7 @@
 <span class="identifier">dminutes</span> <span class="identifier">dm4</span> <span class="special">=</span> <span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span><span class="special">;</span> <span class="comment">// dm4.count() == 5.000000083333333
 </span></pre>
 <a name="boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_"></a><h5>
-<a name="id4813340"></a>
+<a name="id4813226"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_">How
           expensive is all of this?</a>
         </h5>
@@ -364,7 +363,7 @@
           tick counts.
         </p>
 <a name="boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a__code__phrase_role__identifier__duration__phrase___code__parameter_"></a><h5>
-<a name="id4813390"></a>
+<a name="id4813276"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a__code__phrase_role__identifier__duration__phrase___code__parameter_">How
           complicated is it to build a function taking a <code class="computeroutput"><span class="identifier">duration</span></code>
           parameter?</a>
@@ -486,7 +485,8 @@
           </li>
 </ol></div>
 <p>
- Boost.Chrono proposes 3 concrete clocks:
+ __Boost<span class="underline">Chrono</span>_ proposes 3 concrete
+ clocks:
         </p>
 <div class="orderedlist"><ol type="1">
 <li>
@@ -577,16 +577,16 @@
           of the epoch no longer has meaning.
         </p>
 <p>
- In Boost.Chrono, an epoch is a purely abstract and unspecified concept.
- There is no type representing an epoch. It is simply an idea that relates
- (or doesn't) <code class="computeroutput"><span class="identifier">time_point</span></code>s
- to a clock, and in the case that they share a clock, <code class="computeroutput"><span class="identifier">time_point</span></code>s
+ In __Boost<span class="underline">Chrono</span>_, an epoch is a
+ purely abstract and unspecified concept. There is no type representing
+ an epoch. It is simply an idea that relates (or doesn't) <code class="computeroutput"><span class="identifier">time_point</span></code>s to a clock, and in the case
+ that they share a clock, <code class="computeroutput"><span class="identifier">time_point</span></code>s
           to one another. <code class="computeroutput"><span class="identifier">time_point</span></code>s
           associated with different clocks are generally not interoperable unless
           the relationship between the epochs associated with each clock is known.
         </p>
 <a name="boost_chrono.overview.motivation.time_point.so_what_exactly_is_a__code__phrase_role__identifier__time_point__phrase___code__and_how_do_i_use_one_"></a><h5>
-<a name="id4815185"></a>
+<a name="id4815082"></a>
           <a href="motivation.html#boost_chrono.overview.motivation.time_point.so_what_exactly_is_a__code__phrase_role__identifier__time_point__phrase___code__and_how_do_i_use_one_">So
           What Exactly is a <code class="computeroutput"><span class="identifier">time_point</span></code>
           and How Do I Use One?</a>
@@ -709,7 +709,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="../overview.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../users_guide.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="../overview.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="caveat_emptor.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/chrono_hpp.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/chrono_hpp.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/chrono_hpp.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -320,7 +320,7 @@
           and both of these calls happen before <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">::</span><span class="identifier">max</span><span class="special">()</span></code>.
         </p>
 <div class="table">
-<a name="id4829182"></a><p class="title"><b>Table 1. Clock Requirements</b></p>
+<a name="id4829308"></a><p class="title"><b>Table 1. Clock Requirements</b></p>
 <table class="table" summary="Clock Requirements">
 <colgroup>
 <col>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -6,7 +6,7 @@
 <meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
 <link rel="start" href="../index.html" title="Boost.Chrono">
 <link rel="up" href="../index.html" title="Boost.Chrono">
-<link rel="prev" href="overview/motivation.html" title="Motivation">
+<link rel="prev" href="overview/caveat_emptor.html" title="Caveat emptor">
 <link rel="next" href="users_guide/getting_started.html" title=" Getting Started">
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
@@ -20,7 +20,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="overview/motivation.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="users_guide/getting_started.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="overview/caveat_emptor.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="users_guide/getting_started.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 <div class="section" lang="en">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -48,7 +48,7 @@
 </tr></table>
 <hr>
 <div class="spirit-nav">
-<a accesskey="p" href="overview/motivation.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="users_guide/getting_started.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+<a accesskey="p" href="overview/caveat_emptor.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="users_guide/getting_started.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
 </div>
 </body>
 </html>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/ext_references.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/ext_references.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/ext_references.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -36,11 +36,21 @@
             "time", 20.4 Compile-time rational arithmetic "ratio",
             20.6.7 Other transformations "meta.trans.other"
           </p></dd>
-<dt><span class="term">N2661 - A Foundation to Sleep On</span></dt>
+<dt><span class="term">N2661 - A Foundation to Sleep On</span></dt>
 <dd><p>
             From Howard E. Hinnant, Walter E. Brown, Jeff Garland and Marc Paterno.
             Is very informative and provides motivation for key design decisions
           </p></dd>
+<dt><span class="term">LGW 934. duration is missing operator%</span></dt>
+<dd><p>
+ From Terry Golubiewski. Is very informative and provides motivation for
+ key design decisions
+ </p></dd>
+<dt><span class="term"><a href="http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1281" target="_top"><span class="bold"><strong>LWG 1281. CopyConstruction and Assignment between ratios having
+ the same normalized form</strong></span></a></span></dt>
+<dd><p>
+ From Vicente Juan Botet Escriba.
+ </p></dd>
 </dl>
 </div>
 </div>

Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -38,33 +38,33 @@
         Installing Chrono">
         Installing Chrono</a>
 </h4></div></div></div>
-<a name="boost_chrono.users_guide.getting_started.install.getting_boost_chrono"></a><h5>
-<a name="id4816001"></a>
- <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.getting_boost_chrono">Getting
- Boost.Chrono</a>
+<a name="boost_chrono.users_guide.getting_started.install.getting___boost_emphasis_role__underline__chrono__emphasis__"></a><h5>
+<a name="id4816069"></a>
+ <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.getting___boost_emphasis_role__underline__chrono__emphasis__">Getting
+ __Boost<span class="underline">Chrono</span>_</a>
         </h5>
 <p>
- You can get the last stable release of Boost.Chrono by downloading <code class="literal">chrono.zip</code>
- from the <a href="http://www.boost-consulting.com/vault/index.php?directory=System" target="_top">Boost
+ You can get the last stable release of __Boost<span class="underline">Chrono</span>_
+ by downloading <code class="literal">chrono.zip</code> from the <a href="http://www.boost-consulting.com/vault/index.php?directory=System" target="_top">Boost
           Vault</a>
         </p>
 <p>
           You can also access the latest (unstable?) state from the <a href="https://svn.boost.org/svn/boost/sandbox/chrono" target="_top">Boost
           Sandbox</a>.
         </p>
-<a name="boost_chrono.users_guide.getting_started.install.building_boost_chrono"></a><h5>
-<a name="id4816049"></a>
- <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building_boost_chrono">Building
- Boost.Chrono</a>
+<a name="boost_chrono.users_guide.getting_started.install.building___boost_emphasis_role__underline__chrono__emphasis__"></a><h5>
+<a name="id4816129"></a>
+ <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building___boost_emphasis_role__underline__chrono__emphasis__">Building
+ __Boost<span class="underline">Chrono</span>_</a>
         </h5>
 <p>
- __Boost<span class="underline">Chono</span>_ is not a header only
+ __Boost<span class="underline">Chrono</span>_ is not a header only
           library. You need to compile it before use.
         </p>
 <pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">libs</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">build</span>
 </pre>
 <a name="boost_chrono.users_guide.getting_started.install.requirements"></a><h5>
-<a name="id4816111"></a>
+<a name="id4816195"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.requirements">Requirements</a>
         </h5>
 <p>
@@ -73,7 +73,8 @@
           version in SVN trunk (even if older version should works also).
         </p>
 <p>
- In particular, Boost.Chrono depends on:
+ In particular, __Boost<span class="underline">Chrono</span>_ depends
+ on:
         </p>
 <div class="variablelist">
 <p class="title"><b></b></p>
@@ -105,7 +106,7 @@
 </dl>
 </div>
 <a name="boost_chrono.users_guide.getting_started.install.exceptions_safety"></a><h5>
-<a name="id4816269"></a>
+<a name="id4816358"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.exceptions_safety">Exceptions
           safety</a>
         </h5>
@@ -114,7 +115,7 @@
           of exception safety as long as the underlying parameters provide it.
         </p>
 <a name="boost_chrono.users_guide.getting_started.install.thread_safety"></a><h5>
-<a name="id4816295"></a>
+<a name="id4816384"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.thread_safety">Thread
           safety</a>
         </h5>
@@ -122,7 +123,7 @@
           All functions in the library are thread-unsafe except when noted explicitly.
         </p>
 <a name="boost_chrono.users_guide.getting_started.install.tested_compilers"></a><h5>
-<a name="id4816320"></a>
+<a name="id4816408"></a>
           <a href="getting_started.html#boost_chrono.users_guide.getting_started.install.tested_compilers">Tested
           compilers</a>
         </h5>

Modified: sandbox/chrono/libs/chrono/doc/html/index.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/index.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/index.html 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -50,7 +50,10 @@
 <p><b>Table of Contents</b></p>
 <dl>
 <dt><span class="section">Overview</span></dt>
-<dd><dl><dt><span class="section">Motivation</span></dt></dl></dd>
+<dd><dl>
+<dt><span class="section">Motivation</span></dt>
+<dt><span class="section">Caveat emptor</span></dt>
+</dl></dd>
 <dt><span class="section"> Users'Guide</span></dt>
 <dd><dl>
 <dt><span class="section"> Getting Started</span></dt>
@@ -111,7 +114,7 @@
 </table></div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: December 08, 2009 at 12:46:15 GMT</small></p></td>
+<td align="left"><p><small>Last revised: December 08, 2009 at 21:37:24 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest (original)
+++ sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -1,6 +1,7 @@
 index.html
 boost_chrono/overview.html
 boost_chrono/overview/motivation.html
+boost_chrono/overview/caveat_emptor.html
 boost_chrono/users_guide.html
 boost_chrono/users_guide/getting_started.html
 boost_chrono/users_guide/tutorial.html

Modified: sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp (original)
+++ sandbox/chrono/libs/chrono/test/ratio_fail_test1.cpp 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -7,12 +7,6 @@
 
 #include <boost/ratio.hpp>
 
-#if 0
-typedef boost::ratio<0x7FFFFFFF, 0x7FFFFFF0> R1;
-typedef boost::ratio<0x7FFFFFFF, 0x7FFFFFF0> R2;
+typedef boost::ratio<INTMAX_C(0x7FFFFFFFFFFFFFFF), INTMAX_C(0x7FFFFFFFFFFFFFF0)> R1;
+typedef boost::ratio<INTMAX_C(0x7FFFFFFFFFFFFFFE), INTMAX_C(0x7FFFFFFFFFFFFFF0)> R2;
 typedef boost::ratio_multiply<R1, R2>::type RT;
-#else
-typedef boost::ratio<0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF0> R1;
-typedef boost::ratio<0x7FFFFFFFFFFFFFFE, 0x7FFFFFFFFFFFFFF0> R2;
-typedef boost::ratio_multiply<R1, R2>::type RT;
-#endif

Modified: sandbox/chrono/libs/chrono/test/ratio_test.cpp
==============================================================================
--- sandbox/chrono/libs/chrono/test/ratio_test.cpp (original)
+++ sandbox/chrono/libs/chrono/test/ratio_test.cpp 2009-12-08 16:45:29 EST (Tue, 08 Dec 2009)
@@ -11,15 +11,13 @@
 #include <iostream>
 #include <complex>
 
-#if 0
 template <class T, class U>
 typename boost::common_type<std::complex<T>, std::complex<U> >::type
 operator+(std::complex<T>, std::complex<U>);
-#else
+
 template <class T, class U>
 std::complex<typename boost::common_type<T, U>::type>
-operator+(std::complex<T>, std::complex<U>);
-#endif
+operator-(std::complex<T>, std::complex<U>);
 
 typedef boost::ratio<5, 3> five_thirds; // five_thirds::num == 5, five_thirds::den == 3
 typedef boost::ratio<25, 15> also_five_thirds; // also_five_thirds::num == 5, also_five_thirds::den == 3
@@ -31,11 +29,7 @@
 
 // Test the case described in library working group issue 948.
 
-#if 0
-typedef boost::ratio<0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFF0> R1;
-#else
-typedef boost::ratio<0x7FFFFFFF, 0x7FFFFFF0> R1;
-#endif
+typedef boost::ratio<INTMAX_C(0x7FFFFFFFFFFFFFFF), INTMAX_C(0x7FFFFFFFFFFFFFF0)> R1;
 typedef boost::ratio<8, 7> R2;
 typedef boost::ratio_multiply<R1, R2>::type RT;
 
@@ -216,25 +210,18 @@
 // Though input can be arbitrary (but type-safe) units, output is always in SI-units
 // (a limitation of the simplified Units lib demoed here).
 
-#if 0
- typedef quantity<typename boost::ratio_subtract<R1, R3>::type, typename boost::ratio_subtract<R2, R4>::type> R;
- R r;
- r.set(x.get() / y.get());
- return r;
-typedef quantity<boost::ratio<1>, boost::ratio<0> > Time; // second
-typedef quantity<boost::ratio<0>, boost::ratio<1> > Distance; // meter
- typedef R1 time_dim;
- typedef R2 distance_dim;
-}
-#endif
 
- typedef User1::quantity<boost::ratio_subtract<boost::ratio<0>, boost::ratio<1> >::type,
- boost::ratio_subtract<boost::ratio<1>, boost::ratio<0> >::type > RR;
- //typedef User1::quantity<boost::ratio_subtract<boost::ratio<1>, boost::ratio<0> >::type,
- // boost::ratio_subtract<boost::ratio<0>, boost::ratio<1> >::type > RR;
 
 int main()
 {
+ typedef boost::ratio<8, INTMAX_C(0x7FFFFFFFD)> R1;
+ typedef boost::ratio<3, INTMAX_C(0x7FFFFFFFD)> R2;
+ typedef User1::quantity<boost::ratio_subtract<boost::ratio<0>, boost::ratio<1> >::type,
+ boost::ratio_subtract<boost::ratio<1>, boost::ratio<0> >::type > RR;
+ typedef boost::ratio_subtract<R1, R2>::type RS;
+ std::cout << RS::num << '/' << RS::den << '\n';
+
+
     std::cout << "*************\n";
     std::cout << "* testUser1 *\n";
     std::cout << "*************\n";


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