|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63639 - in sandbox/chrono/libs/chrono/doc: . html html/boost_chrono html/boost_chrono/appendices html/boost_chrono/overview html/boost_chrono/reference html/boost_chrono/users_guide
From: vicente.botet_at_[hidden]
Date: 2010-07-04 18:18:38
Author: viboes
Date: 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
New Revision: 63639
URL: http://svn.boost.org/trac/boost/changeset/63639
Log:
Update doc
Text files modified:
sandbox/chrono/libs/chrono/doc/chrono.qbk | 2381 +++++++++++++++++++++------------------
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html | 3
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html | 75
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/history.html | 20
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html | 4
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/rationale.html | 47
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html | 62
sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/todo.html | 9
sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview.html | 37
sandbox/chrono/libs/chrono/doc/html/boost_chrono/overview/motivation.html | 1055 +---------------
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html | 1171 ++++++++++++-------
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated.html | 9
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/formatters.html | 3
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/other_clocks.html | 27
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html | 26
sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html | 51
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide.html | 37
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html | 1056 +++++++++-------
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/getting_started.html | 22
sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html | 1107 +++++++++++++++++
sandbox/chrono/libs/chrono/doc/html/index.html | 7
sandbox/chrono/libs/chrono/doc/html/standalone_HTML.manifest | 1
22 files changed, 4016 insertions(+), 3194 deletions(-)
Modified: sandbox/chrono/libs/chrono/doc/chrono.qbk
==============================================================================
--- sandbox/chrono/libs/chrono/doc/chrono.qbk (original)
+++ sandbox/chrono/libs/chrono/doc/chrono.qbk 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -26,14 +26,82 @@
[/==================]
[def __Boost_Chrono__ [*Boost.Chrono]]
+[/===============================================]
-[def __ratio__ [link boost_chrono.reference.cpp0x.ratio_hpp.ratio `ratio`]]
-
-[/==================]
[template common_type_link[link_text] [link boost_chrono.reference.cpp0x.common_type_hpp.common_type [link_text]]]
[def __common_type__ [common_type_link `common_type`]]
+[template common_type_macros[link_text] [link boost_chrono.reference.cpp0x.common_type_hpp.conf [link_text]]]
+
+[template common_type_pp[link_text] [link boost_chrono.reference.cpp0x.common_type_hpp.pp [link_text]]]
+
+[def __common_type__BOOST_COMMON_TYPE_USES_STATIC_ASSERT [common_type_macros `BOOST_COMMON_TYPE_USES_STATIC_ASSERT`]]
+[def __common_type__BOOST_COMMON_TYPE_USES_MPL_ASSERT [common_type_macros `BOOST_COMMON_TYPE_USES_MPL_ASSERT`]]
+[def __common_type__BOOST_COMMON_TYPE_USES_ARRAY_ASSERT [common_type_macros `BOOST_COMMON_TYPE_USES_ARRAY_ASSERT`]]
+[def __common_type__BOOST_COMMON_TYPE_ARITY [common_type_pp `BOOST_COMMON_TYPE_ARITY`]]
+
+
+[/===============================================]
+[def __ratio__ [link boost_chrono.reference.cpp0x.ratio_hpp.ratio `ratio`]]
+
+
+[template ratio_conf[link_text] [link boost_chrono.reference.cpp0x.ratio_hpp.conf [link_text]]]
+
+[template ratio_pp[link_text] [link boost_chrono.reference.cpp0x.ratio_hpp.pp [link_text]]]
+
+[def __BOOST_RATIO_USES_STATIC_ASSERT [ratio_conf `BOOST_RATIO_USES_STATIC_ASSERT`]]
+[def __BOOST_RATIO_USES_MPL_ASSERT [ratio_conf `BOOST_RATIO_USES_MPL_ASSERT`]]
+[def __BOOST_RATIO_USES_ARRAY_ASSERT [ratio_conf `BOOST_RATIO_USES_ARRAY_ASSERT`]]
+
+[template ratio_arithmetic[link_text] [link boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic [link_text]]]
+[def __ratio_add [ratio_arithmetic `ratio_add`]]
+[def __ratio_subtract [ratio_arithmetic `ratio_subtract`]]
+[def __ratio_multiply [ratio_arithmetic `ratio_multiply`]]
+[def __ratio_divide [ratio_arithmetic `ratio_divide`]]
+
+
+[template ratio_comparison[link_text] [link boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison [link_text]]]
+[def __ratio_equal [ratio_comparison `ratio_equal`]]
+[def __ratio_not_equal [ratio_comparison `ratio_not_equal`]]
+[def __ratio_less [ratio_comparison `ratio_less`]]
+[def __ratio_less_equal [ratio_comparison `ratio_less_equal`]]
+[def __ratio_greater [ratio_comparison `ratio_greater`]]
+[def __ratio_greater_equal [ratio_comparison `ratio_greater_equal`]]
+
+
+[template ratio_si_typedefs[link_text] [link boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs [link_text]]]
+[def __atto [ratio_si_typedefs `atto`]]
+[def __femto [ratio_si_typedefs `femto`]]
+[def __pico [ratio_si_typedefs `pico`]]
+[def __nano [ratio_si_typedefs `nano`]]
+[def __micro [ratio_si_typedefs `micro`]]
+[def __milli [ratio_si_typedefs `milli`]]
+[def __centi [ratio_si_typedefs `centi`]]
+[def __deci [ratio_si_typedefs `deci`]]
+[def __deca [ratio_si_typedefs `deca`]]
+[def __hecto [ratio_si_typedefs `hecto`]]
+[def __kilo [ratio_si_typedefs `kilo`]]
+[def __mega [ratio_si_typedefs `mega`]]
+[def __giga [ratio_si_typedefs `giga`]]
+[def __tera [ratio_si_typedefs `tera`]]
+[def __peta [ratio_si_typedefs `peta`]]
+[def __exa [ratio_si_typedefs `exa`]]
+
+
[/==================]
+
+
+[template chrono_conf[link_text] [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf [link_text]]]
+
+
+[def __BOOST_CHRONO_USES_STATIC_ASSERT [chrono_conf `BOOST_CHRONO_USES_STATIC_ASSERT`]]
+[def __BOOST_CHRONO_USES_MPL_ASSERT [chrono_conf `BOOST_CHRONO_USES_MPL_ASSERT`]]
+[def __BOOST_CHRONO_USES_ARRAY_ASSERT [chrono_conf `BOOST_CHRONO_USES_ARRAY_ASSERT`]]
+
+[def __BOOST_CHRONO_HAS_CLOCK_MONOTONIC [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC `BOOST_CHRONO_HAS_CLOCK_MONOTONIC`]]
+
+
+
[template clock_concept_link[link_text] [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock [link_text]]]
[def __clock_concept__ [clock_concept_link `Clock` concept]]
[def __clock_concept_type__ [clock_concept_link `Clock`]]
@@ -64,22 +132,18 @@
[def __duration_cast__ [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast `duration_cast`]]
+[def __time_point_cast__ [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_cast `time_point_cast`]]
-[/==================]
-[/template minutes_link[link_text] [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.minutes [link_text]]]
-[template minutes_link[link_text] [link_text]]
-[def __minutes__ [minutes_link `minutes`]]
-
-[/==================]
-[/template nanoseconds_link[link_text] [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.nanoseconds [link_text]]]
-[template nanoseconds_link[link_text] [link_text]]
-[def __nanoseconds__ [nanoseconds_link `nanoseconds`]]
+[template duration_typedefs[link_text] [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs [link_text]]]
+[def __nanoseconds__ [duration_typedefs `nanoseconds`]]
+[def __microseconds__ [duration_typedefs `microseconds`]]
+[def __milliseconds__ [duration_typedefs `milliseconds`]]
+[def __seconds__ [duration_typedefs `seconds`]]
+[def __minutes__ [duration_typedefs `minutes`]]
+[def __hours__ [duration_typedefs `hours`]]
-[/==================]
-[/template seconds_link[link_text] [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.seconds [link_text]]]
-[template seconds_link[link_text] [link_text]]
-[def __seconds__ [seconds_link `seconds`]]
+[def __common_type_spe__ [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe `common_type`]]
[/==================]
[def __treat_as_floating_point__ [link boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.treat_as_floating_point `treat_as_floating_point`]]
@@ -87,6 +151,13 @@
[/==================]
+[template SuspendibleClock_concept_link[link_text] [link boost_chrono.reference.other_clocks.suspendible_clock_req [link_text]]]
+[def __SuspendibleClock_concept__ [SuspendibleClock_concept_link `SuspendibleClock` concept]]
+[def __SuspendibleClock_concept_type__ [SuspendibleClock_concept_link `SuspendibleClock`]]
+[def __SuspendibleClock_req__ [SuspendibleClock_concept_link `SuspendibleClock` requirements]]
+[def __SuspendibleClock__ [SuspendibleClock_concept_link `SuspendibleClock`]]
+
+[/==================]
[template stopwatch_concept_link[link_text] [link boost_chrono.reference.stopwatches.stopwatch_req [link_text]]]
[def __stopwatch_concept__ [stopwatch_concept_link `Stopwatch` concept]]
[def __stopwatch_concept_type__ [stopwatch_concept_link `Stopwatch`]]
@@ -100,6 +171,8 @@
[def __stopwatch_reporter__ [link boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter `stopwatch_reporter`]]
+[def __stopclock_accumulator__ [link boost_chrono.reference.reporters.stopclock_accumulator_hpp.stopclock_accumulator `stopclock_accumulator`]]
+
[/==================]
[template formatter_concept_link[link_text] [link boost_chrono.reference.reporters.formatter_req [link_text]]]
[def __formatter_concept__ [formatter_concept_link `Formatter` concept]]
@@ -122,6 +195,8 @@
[def __suspendible_clock__ [link boost_chrono.reference.other_clocks.suspendible_clock_hpp.suspendible_clock `suspendible_clock`]]
+
+
[warning Chrono is not part of the Boost libraries.]
[/===============]
@@ -161,12 +236,12 @@
It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests. process clocks provide a thin wrapper around the operating system's process timer API. For POSIX-like systems, that's the times() function, while for Windows, it's the GetProcessTimes() function.
-* __process_real_CPU_clock__, capturing real-CPU times.
-* __process_user_CPU_clock__, capturing user-CPU times.
-* __process_system_CPU_clock__, capturing system-CPU times.
+* __process_real_cpu_clock__, capturing real-CPU times.
+* __process_user_cpu_clock__, capturing user-CPU times.
+* __process_system_cpu_clock__, capturing system-CPU times.
* `process_cpu_clock`, tuple-like class capturing at once real, user-CPU, and system-CPU times.
-To complete the clocks __Boost_Chrono__ provides, in platforms support them, thread clocks.
+To complete the clocks __Boost_Chrono__ provides, in platforms having the needed support, thread clocks.
[/
@@ -209,661 +284,613 @@
[section Motivation]
[/=================]
+[heading Time]
+
We all deal with time every day of our lives. We've intuitively known it since birth. Thus we are all very familiar with it and believe it to be a simple matter. The modeling of time in computer programs should be similarly simple.
The unfortunate truth is that this perceived simplicity is only skin deep. Fortunately however, we do not need a terribly complicated solution to meet the bulk of our needs. However, overly simplistic solutions are fraught with danger, inherent inefficiency, and lack the ability to adapt as the computer industry evolves over decades.
__Boost_Chrono__ proposes a solution that is precision neutral, with a very simple end user interface which supports multiple clocks, multiple precisions (both coarser and finer than we will ever need), separate types for points in time and time durations, efficiency, and compile time enforced safety.
-In addition to the clocks provided by the standard proposal, __Boost_Chrono__ provides specific process clocks and a thread clock.
+[/In addition to the clocks provided by the standard proposal, __Boost_Chrono__ provides specific process clocks and a thread clock.]
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`. This documentation contains a lot of extracts from this document.
+[heading Wall clock versus system and user time]
-[section Common type]
+It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests.
-__common_type__ has been a recurring theme in many places for many years. We've previously known it as promote and examples of it are spread throughout boost. It has been reinvented independently several times, because it is so useful.
+[/3 concrete process clocks:
-Andrei Alexandrescu recently pointed us at a D library: std.traits - D Programming Language - Digital Mars, which became the motivation for this particular name, and the variadic nature of [@http://www.digitalmars.com/d/2.0/phobos/std_traits.html#CommonType this trait].
+# `process_real_CPU_clock`,
+# `process_user_CPU_clock`,
+# `process_system_CPU_clock`
-In a nutshell, __common_type__ is a trait that takes 1 or more types, and returns a type which all of the types will convert to. The default definition demands this conversion be implicit. However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, and yet still want to interoperate with the __common_type__ facility.
+providing a
+]
+__Boost_Chrono__ provides
+thin wrappers around the operating system's process timer API. For POSIX-like systems, that's the times() function, while for Windows, it's the GetProcessTimes() function.
-[*Example:]
+[/These clocks capture the specific time unitarily. __Boost_Chrono__ provides also a clock `process_cpu_clock` that captures the three times at once.
+]
- template <class T, class U>
- typename common_type<complex<T>, complex<U> >::type
- operator+(complex<T>, complex<U>);
+[/
+ using namespace boost::chrono;
+ int main()
+ {
+ stopwatch_reporter<stopwatch<process_cpu_clock> > _;
+ // ...
+ }
-In the above example, "mixed-mode" complex arithmetic is allowed. The return type is described by __common_type__. For example the resulting type of adding a `complex<int>` and `complex<double>` might be a `complex<double>`. Another choice for the author might be:
+Will produce the following output
- template <class T, class U>
- complex<typename common_type<T, U>::type>
- operator+(complex<T>, complex<U>);
+ real 0.034s, cpu 0.031s (93.0%), user 0.031s, system 0.000s
-Here is how someone might produce a variadic comparison function:
+As this is one of the expression more commonly use, the library provides a stopclock shortcut so the preceding can be writen as
- template <class ...T>
- typename common_type<T...>::type
- min(T... t);
+ using namespace boost::chrono;
+ int main()
+ {
+ __stopclock__<> _;
+ // ...
+ }
+]
-This is a very useful and broadly applicable utility. The __duration__ and __time_point__ facilities use it to make multi-precision arithmetic seamless and exact.
+[heading Reporting slapsed time]
+Knowing how long a program, a function or a specific block takes to execute is useful in both test and production environments.
+__Boost_Chrono__ introduces the __Stopwatch__ concept which captures the mechanism to measure the elapsed time.
+A Stopwatch allows to start, stop, suspend and resume the measure of the eleapsed time.
+__stopwatch__`<>` is the basic model of __Stopwatch__ allowing to make a single measure.
-[endsect]
+At the user level, the main use case of measuring the elapsed time is to report these measures on the display.
+__stopwatch_reporter__`<>` provides a run time reporting package that can be invoked in a single line of code to report the usage of a Clock.
-[section Ratio]
-__ratio__ is a general purpose utility inspired by Walter Brown allowing one to easily and safely compute rational values at compile time. The __ratio__ class catches all errors (such as divide by zero and overflow) at compile time. It is used in the __duration__ and __time_point__ classes to efficiently create units of time. It can also be used in other "quantity" libraries (both std-defined and user-defined), or anywhere there is a rational constant which is known at compile time. The use of this utility can greatly reduce the chances of run time overflow because the __ratio__ (and any ratios resulting from __ratio__ arithmetic) are always reduced to lowest terms.
-__ratio__ is a template taking two intmax_ts, with the second defaulted to 1. In addition to copy constructors and assignement, it only has two public members, both of which are static const intmax_t. One is the numerator of the __ratio__ and the other is the denominator. The __ratio__ is always normalized such that it is expressed in lowest terms, and the denominator is always positive. When the numerator is 0, the denominator is always 1.
+[heading Caveat emptor]
-[*Example:]
+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.
- typedef ratio<5, 3> five_thirds; // five_thirds::num == 5, five_thirds::den == 3
- typedef ratio<25, 15> also_five_thirds; // also_five_thirds::num == 5, also_five_thirds::den == 3
- typedef ratio_divide<five_thirds, also_five_thirds>::type one; // one::num == 1, one::den == 1
+[heading How reliable are these measures?]
-This facility also includes convenience typedefs for the SI prefixes `atto` through `exa` corresponding to their internationally recognized definitions (in terms of __ratio__). This is a tremendous syntactic convenience. It will prevent errors in specifying constants as one no longer has to double count the number of zeros when trying to write million or billion.
+[/note this section need to be reworked, the ideas are there, but ...]
-[*Example:]
+There are three context on which you can get unreliable measures:
- typedef ratio_multiply<ratio<5>, giga>::type _5giga; // _5giga::num == 5000000000, _5giga::den == 1
- typedef ratio_multiply<ratio<5>, nano>::type _5nano; // _5nano::num == 1, _5nano::den == 200000000
+* Precission of your clock. If the precission of your clock is 10ms you can not be able to measure the time spent by blocks of code that takes the same order of magnitude. The library provides a hig_resolution_clock that gives you the higher resolution available on your platform. Respect to the precission, nothing to do except to take the clock with the highest resolution and measures blocks of code that will spent time having more than one order of magnitude the precission of the clock.
-[endsect]
+``
+#include <boost/chrono/chrono.hpp>
+ ...
+ __stopclock__<__high_resolution_clock__> _;
+``
+* When your application is multithreaded, and you use a process clock, the time you get is the delay during which your block has been executed, in concurrency with the other threads of execution. If what you want is the time spent by this specific thread another clock is needed. The library provide a __thread_clock__ that returns the time spent by the thread on platforms providing this kind of data.
-[section Duration]
+* Nested stopclocks (usually nested function calls where each function contains a stopclock). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
-The __duration__ is the heart of this library. The interface that the user will see in everyday use is nearly identical to that of Boost.DateTime time __duration_s__ authored by Jeff Garland, both in syntax and in behavior. This has been a very popular boost library for 7 years. There is an enormous positive history with this interface.
+Some measures let us think that most of the time spent by the stopclock mechanism is associated to the logging part. There are two things we can do to make the difference :
-The library consists of six units of time __duration__:
+* Avoid expensive operations as logging while doing the measures. Note that reporting in itself is not too expensive as far as we don't need to flush the buffer. This can be achieved either using a __stopwatch_accumulator__, 'i.e. don't report until all the measures have been compiled and then report some statistics or using an asynchronous stream.
-* `hours`
-* __minutes__
-* __seconds__
-* `milliseconds`
-* `microseconds`
-* __nanoseconds__
+* Introduce some cheap mechanism that allows us to make the difference between the application time and the intrinsec stopclock time. When the precission of the clock is enough, we can suspend the counting of the Clock while we are spending time reporting the measures, and resume it once the work is done. The library provide a Clock wrapper __suspendible_clock__ that make the resulting clock suspendible. The stopwatch_reporter is able to detect if the __Clock__ is a __SuspendibleClock__ and then suspend/resume the clock while doing the report.
-These units were chosen as a subset of the boost library because they are the most common units used when sleeping, waiting on a condition variable, or waiting to obtain the lock on a mutex. Each of these units is nothing but a thin wrapper around a signed integral count. That is, when you construct `minutes(3)`, all that happens is a `3` is stored inside of minutes. When you construct `microseconds(3)`, all that happens is a `3` is stored inside of microseconds.
+[/
+ stopclock<suspendible_clock<Clock> > _;
-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.
+See the performances section for more deep details.
+]
+[endsect]
-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.
-A secondary benefit is that by publishing the class template __duration__ interface, user code can very easily create __duration_s__ with any precision they desire. The __ratio__ utility is used to specify the precision, so as long as the precision can be expressed by a rational constant with respect to seconds, this framework can exactly represent it (one third of a second is no problem, and neither is one third of a `femto` second). All of this utility and flexibility comes at no cost just by making use of the no-run-time-overhead __ratio__ facility.
+[endsect]
-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.
+[/==============================]
+[section:users_guide Users'Guide]
+[/==============================]
-[heading So What Exactly is a __duration__ and How Do I Use One?]
+[/======================================]
+[section:getting_started Getting Started]
+[/======================================]
-A __duration__ has a representation and a tick period (precision).
+[/======================================]
+[section:install Installing Chrono]
+[/======================================]
- template <class Rep, class Period = ratio<1> > class duration;
+[/=================================]
+[heading Getting __Boost_Chrono__ ]
+[/=================================]
-The representation is simply any arithmetic type, or an emulation of such a type. The representation stores a count of ticks. This count is the only data member stored in a __duration__. If the representation is floating point, it can store fractions of a tick to the precision of the representation. The tick period is represented by a __ratio__ and is encoded into the __duration__'s type, instead of stored. The tick period only has an impact on the behavior of the __duration__ when a conversion between different __duration__'s is attempted. The tick period is completely ignored when simply doing arithmetic among like __duration_s__.
+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]
-[*Example:]
+You can also access the latest (unstable?) state from the [@https://svn.boost.org/svn/boost/sandbox/chrono Boost Sandbox]. Just go to [@http://svn.boost.org/trac/boost/wiki/BoostSubversion here] and follow the instructions there for anonymous SVN access.
- typedef duration<long, ratio<60> > minutes;
- minutes m1(3); // m1 stores 3
- minutes m2(2); // m2 stores 2
- minutes m3 = m1 + m2; // m3 stores 5
+[/==========================================]
+[heading Where to install __Boost_Chrono__? ]
+[/==========================================]
- typedef duration<long long, micro> microseconds;
- microseconds us1(3); // us1 stores 3
- microseconds us2(2); // us2 stores 2
- microseconds us3 = us1 + us2; // us3 stores 5
+The simple way is to decompress (or checkout from SVN) the file in your BOOST_ROOT directory.
- microseconds us4 = m3 + us3; // us4 stores 300000005
+Othesewise, if you decompress in a different directory, you will need to comment some lines, and uncomment and change others in the build/Jamfile and test/Jamfile. Sorry for this, but I have not reached yet to write a Jamfile that is able to work in both environements and use the BOOST_ROOT variable. Any help is welcome.
-In the final line of code above, there is an implicit conversion from minutes to microseconds, resulting in a relatively large number of microseconds.
+[/=================================]
+[heading Building __Boost_Chrono__ ]
+[/=================================]
-If you need to access the tick count within a __duration__, there is a member `count()` which simply returns the stored tick count.
+__Boost_Chrono__ is not a header only library. You need to compile it before use.
- long long tc = us4.count(); // tc is 300000005
+ bjam libs/chrono/build
-These __duration_s__ have very simple, very predictable, and very observable behavior. After all, this is really nothing but the time tested interface of Jeff's boost time __duration__ library (unified with templates instead of inheritance).
+[/===================]
+[heading Requirements]
+[/===================]
-[heading What happens if I assign `m3 + us3` to `minutes` instead of `microseconds`?]
+[*Boost.Chrono] 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 versions should works also).
- minutes m4 = m3 + us3;
+In particular, __Boost_Chrono__ depends on:
-It won't compile. The rationale is that implicit truncation error should not be allowed to happen. If this were to compile, then `m4` would hold `5`, the same value as `m3`. The value associated with `us3` has been effectively ignored. This is similar to the problem of assigning a double to an `int`: the fractional part gets silently discarded.
+[variablelist
+[
+ [[@http://www.boost.org/libs/config [*Boost.Config]]] [for configuration purposes, ...]
+]
+[
+ [[@http://www.boost.org/libs/exception [*Boost.Exception]]] [for throw_exception, ...]
+]
+[
+ [[@http://www.boost.org/libs/integer [*Boost.Integer]]] [for cstdint conformance, ...]
+]
+[
+ [[@http://www.boost.org/libs/system [*Boost.System]]] [for error_code, ...]
+]
+[
+ [[@http://www.boost.org/libs/type_traits [*Boost.TypeTraits]]] [for is_base, ...]
+]
+[
+ [[@http://www.boost.org/libs/utility [*Boost.UtiliTy/EnableIf]]] [for enable_if, ...]
+]
+]
-[heading But what if the truncation behavior is what I want to do?]
+__Boost_Chrono__ depends optionaly on:
-There is a __duration_cast__ facility to explicitly ask for this behavior:
+[variablelist
+[
+ [[@http://www.boost.org/libs/accumulator [*Boost.Accumulator]]] [for accumulator_set, and statistics features when stopwatch_accumulator.hpp is included]
+]
+[
+ [[@http://www.boost.org/libs/thread [*Boost.Thread]]] [for thread_specific_ptr when suspendible_clock.hpp is included]
+]
+[
+ [[@http://www.boost.org/libs/typeof [*Boost.Typeof]]] [for duration and time_point registration when typeof/boost/chrono/chrono.hpp is include]
+]
+]
- minutes m4 = duration_cast<minutes>(m3 + us3); // m4.count() == 5
-In general, one can perform __duration__ arithmetic at will. If __duration_cast__ isn't used, and it compiles, the arithmetic is exact. Any place one wants to override this exact arithmetic behavior, __duration_cast__ can be used to explicitly specify that desire. The __duration_cast__ has the same efficiency as the implicit conversion, and will even be exact as often as it can.
+[/=========================================================]
+[heading Building an executable that uses __Boost_Chrono__ ]
+[/=========================================================]
-[heading I'm trafficking in floating point __duration_s__. I don't want to deal with writing `duration_cast` all over the place. I'm content with the precision of my floating point representation]
+In addition to link with the Boost Chrono library you need also to link with the Boost System library.
-Not a problem. When the destination of a conversion has floating point representation, all conversions are allowed to happen implicitly.
+[/=========================]
+[heading Exceptions safety ]
+[/=========================]
- typedef duration<double, ratio<60> > dminutes;
- dminutes dm4 = m3 + us3; // dm4.count() == 5.000000083333333
+All functions in the library are exception-neutral and provide strong guarantee of exception safety as long as the underlying parameters provide it.
-[heading How expensive is all of this?]
+[/=====================]
+[heading Thread safety ]
+[/=====================]
-If you were writing these conversions by hand, you could not make it more efficient. The use of __ratio__ ensures that all conversion constants are simplified as much as possible at compile time. This usually results in the numerator or denominator of the conversion factor simplifying to `1`, and being subsequently ignored in converting the run time values of the tick counts.
+All functions in the library are thread-unsafe except when noted explicitly.
-[heading How complicated is it to build a function taking a __duration__ parameter?]
+[/========================]
+[heading Tested compilers ]
+[/========================]
-There are several options open to the user:
+The implementation will eventually work with most C++03 conforming compilers.
+Current version has been tested on:
-* If the author of the function wants to accept any __duration__, and is willing to work in floating point __duration_s__, he can simply use any floating point __duration__ as the parameter:
+Windows with
- void f(duration<double> d) // accept floating point seconds
- {
- // d.count() == 3.e-6 when passed microseconds(3)
- }
+* MSVC 10.0
+* MSVC 9.0 Express
+* MSVC 8.0
- f(microseconds(3));
+[/* Intel 11.0]
-* If the author of the function wants to traffic only in integral __duration_s__, and is content with handling nothing finer than say nanoseconds (just as an example), he can simply specify nanoseconds as the parameter:
+Scientific Linux with
- void f(nanoseconds d)
- {
- // d.count() == 3000 when passed microseconds(3)
- }
+* GCC 4.1.2
- f(microseconds(3));
+Cygwin with
-In this design, if the client wants to pass in a floating point __duration__, or a __duration__ of finer precision than nanoseconds, then the client is responsible for choosing his own rounding mode in the conversion to nanoseconds.
+* GCC 3.4.4
+* GCC 4.3.2
- duration<double> s(1./3); // 1/3 of a second
- f(duration_cast<nanoseconds>(s)); // round towards zero in conversion to nanoseconds
+MinGW with
-In the example above, the client of f has chosen "round towards zero" as the desired rounding mode to nanoseconds. If the client has a __duration__ that won't exactly convert to nanoseconds, and fails to choose how the conversion will take place, the compiler will refuse the call:
+* GCC 4.4.0
- f(s); // does not compile
+Initial version was tested on:
-* If the author of the function wants to accept any __duration__, but wants to work with integral representations and wants to control the rounding mode internally, then he can template the function:
+MacOS with GCC 4.2.4
- template <class Rep, class Period>
- void f(duration<Rep, Period> d)
- {
- // convert d to nanoseconds, rounding up if it is not an exact conversion
- nanoseconds ns = duration_cast<nanoseconds>(d);
- if (ns < d)
- ++ns;
- // ns.count() == 333333334 when passed 1/3 of a floating point second
- }
+Ubuntu Linux with GCC 4.2.4
- f(duration<double>(1./3));
+[note Please let us know how this works on other platforms/compilers.]
-* If the author in the example does not want to accept floating point based __duration_s__, he can enforce that behavior like so:
-
- template <class Period>
- void f(duration<long long, Period> d)
- {
- // convert d to nanoseconds, rounding up if it is not an exact conversion
- nanoseconds ns = duration_cast<nanoseconds>(d);
- if (ns < d)
- ++ns;
- // ns.count() == 333333334 when passed 333333333333 picoseconds
- }
-
- f(duration<long long, pico>(333333333333)); // About 1/3 of a second worth of picoseconds
-
-Clients with floating point __duration_s__ who want to use f will now have to convert to an integral __duration__ themselves before passing the result to f.
-
-In summary, the author of f has quite a bit of flexibility and control in the interface he wants to provide his clients with, and easy options for manipulating that __duration__ internal to his function.
+[note Please send any questions, comments and bug reports to boost <at> lists <dot> boost <dot> org.]
[endsect]
+[/====================]
+[section Hello World! ]
+[/====================]
-[section Clocks]
-
-While __duration_s__ only have precision and representation to concern themselves, clocks and __time_point_s__ are intimately related and refer to one another. Because clocks are simpler to explain, we will do so first without fully explaining __time_point_s__. Once clocks are introduced, it will be easier to then fill in what a __time_point__ is.
-
-A clock is a concept which bundles 3 things:
-
-# A concrete __duration__ type.
-# A concrete __time_point__ type.
-# A function called now() which returns the concrete __time_point__.
-
-__Boost_Chrono__ provides the standard concrete clocks:
-
-# system_clock
-# monotonic_clock
-# high_precision_clock
+If all you want to do is to time a program's execution:
-A given platform may not be able to supply all three of these clocks. The user is also able to easily create more clocks.
+ #include <boost/chrono/stopclock.hpp>
-Given a clock named Clock, it will have:
+ ...
- class Clock {
- public:
- typedef an arithmetic-like type rep;
- typedef an instantiation of ratio period;
- typedef boost::chrono::duration<rep, period> duration;
- typedef boost::chrono::time_point<Clock> time_point;
- static const bool is_monotonic = true or false;
+ // add this in the scope you want to time,
+ // at the point you want the timer to start.
+ boost::chrono::__stopclock__<> rt;
- static time_point now();
- };
+Here is a complete program (stopclock_example.cpp):
-One can get the current time from Clock with:
+ #include <boost/chrono/stopclock.hpp>
+ #include <cmath>
- Clock::time_point t1 = Clock::now();
+ int main()
+ {
+ boost::chrono::__stopclock__<> t;
-And one can get the time __duration__ between two __time_point_s__ associated with Clock with:
+ for ( long i = 0; i < 10000000; ++i )
+ std::sqrt( 123.456L ); // burn some time
- Clock::duration d = t1 - Clock::now();
+ return 0;
+ }
-And one can specify a past or future __time_point__ with:
+Debug build output was:
- Clock::time_point t2 = Clock::now() + d;
+ real 0.832s, cpu 0.813s (97.7%), user 0.813s, system 0.000s
-Note how even if a particular clock becomes obsolete, the next clock in line will have the same API. There is no new learning curve to come up. The only source code changes will be simply changing the type of the clock. The same __duration__ and __time_point__ framework continues to work as new clocks are introduced. And multiple clocks are safely and easily handled within the same program.
+In other words, the program took 0.832 real-time (i.e. wall clock) seconds to execute, while the operating system (Windows in this case) charged 0.813 seconds of CPU time to the user and 0 seconds to the system. The total CPU time reported was 0.813 seconds, and that represented utilization of 97.7% of the real-time seconds.
[endsect]
-[section Time Point]
-
-A __time_point__ represents a point in time, as opposed to a __duration__ of time. Another way of saying the same thing, is that a __time_point__ represents an epoch plus or minus a __duration__. Examples of __time_point_s__ include:
+[endsect]
-* 3 minutes after the computer booted.
-* 03:14:07 UTC on Tuesday, January 19, 2038
-* 20 milliseconds after I started that timer.
-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.
+[section Tutorial]
-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.
+[/note If you have not read yet the [@boost_chrono/overview/motivation.html motivation section], please read it now.]
-[heading So What Exactly is a __time_point__ and How Do I Use One?]
+[section Common Type]
-A __time_point__ has a clock and a __duration__.
+__common_type__ has been a recurring theme in many places for many years. We've previously known it as promote and examples of it are spread throughout boost. It has been reinvented independently several times, because it is so useful.
- template <class Clock, class Duration = typename Clock::duration> class time_point;
+Andrei Alexandrescu recently pointed us at a D library: std.traits - D Programming Language - Digital Mars, which became the motivation for this particular name, and the variadic nature of [@http://www.digitalmars.com/d/2.0/phobos/std_traits.html#CommonType this trait].
-The __time_point__'s clock is not stored. It is simply embedded into the __time_point__'s type and serves two purposes:
+[section So What is `common_type` and How can I use it?]
-# Because __time_point_s__ originating from different clocks have different types, the compiler can be instructed to fail if incompatible __time_point_s__ are used in inappropriate ways.
-# Given a __time_point__, one often needs to compare that __time_point__ to "now". This is very simple as long as the __time_point__ knows what clock it is defined with respect to.
+In a nutshell, __common_type__ is a trait that takes 1 or more types, and returns a type which all of the types will convert to. The default definition demands this conversion be implicit. However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, and yet still want to interoperate with the __common_type__ facility.
-A __time_point__'s __duration__ is stored as the only data member of the __time_point__. Thus __time_point_s__ and their corresponding __duration__ have exactly the same layout. But they have very different meanings. For example, it is one thing to say I want to sleep for 3 minutes. It is a completely different thing to say I want to sleep until 3 minutes past the time I started that timer (unless you just happened to start that timer now). Both meanings (and options for sleeping) have great practical value in common use cases for sleeping, waiting on a condition variable, and waiting for a mutex's lock. These same concepts and tools are found (for example) in Ada.
+[*Example:]
-A timer example:
+ template <class T, class U>
+ typename __common_type__<complex<T>, complex<U> >::type
+ operator+(complex<T>, complex<U>);
- void f()
- {
- monotonic_clock::time_point start = monotonic_clock::now();
- g();
- h();
- duration<double> sec = monotonic_clock::now() - start;
- cout << "f() took " << sec.count() << " seconds\n";
- }
+In the above example, "mixed-mode" complex arithmetic is allowed. The return type is described by __common_type__. For example the resulting type of adding a `complex<int>` and `complex<double>` might be a `complex<double>`. Another choice for the author might be:
-Note that if one is using the __duration__ between two clock __time_point_s__ in a way where the precision of the __duration__ matters, it is good practice to convert the clock's native __duration__ to a known __duration__. This insulates the code from future changes which may be made to the clock's native precision in the future. For example monotonic_clock could easily be based on the clock speed of the cpu. When you upgrade to a faster machine, you do not want your code that assumed a certain tick period of this clock to start experiencing run time failures because your timing code has silently changed meaning.
+ template <class T, class U>
+ complex<typename __common_type__<T, U>::type>
+ operator+(complex<T>, complex<U>);
-A delay loop example:
+Here is how someone might produce a variadic comparison function:
- // delay for at least 500 nanoseconds:
- auto go = monotonic_clock::now() + nanoseconds(500);
- while (monotonic_clock::now() < go)
- ;
+ template <class ...T>
+ typename __common_type__<T...>::type
+ min(T... t);
-The above code will delay as close as possible to half a microsecond, no matter what the precision of monotonic_clock is. The more precise __monotonic_clock__ becomes, the more accurate will be the delay to 500 nanoseconds.
+This is a very useful and broadly applicable utility. The __duration__ and __time_point__ facilities use it to make multi-precision arithmetic seamless and exact.
[endsect]
+[section How to get the common type of inter-type with explicit conversions?]
-[section Stopwatches]
+The default definition of __common_type__ demands the conversion be implicit. However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, and yet still want to interoperate with the __common_type__ facility.
-Knowing how long a program, a function or a specific block takes to execute is useful in both test and production environments.
-__Boost_Chrono__ introduces the __Stopwatch__ concept which captures the mechanism to measure the elapsed time.
-A Stopwatch allows to start, stop, suspend and resume the measure of the eleapsed time.
-`stopwatch<>` is the basic model of __Stopwatch__ allowing to make a single measure.
-At the user level, the main use case of measuring the elapsed time is to report these measures on the display.
-`stopwatch_reporter<>` provides a run time reporting package that can be invoked in a single line of code to report the usage of a Clock.
-For example
+[endsect]
- using namespace boost::chrono;
- int f1(long j) {
- stopwatch_reporter<stopwatch<> > _;
+[endsect]
- for ( long i = 0; i < j; ++i )
- std::sqrt( 123.456L ); // burn some time
- return 0;
- }
- int main() {
- f1(100000);
- f1(200000);
- f1(300000);
- return 0;
- }
+[section Ratio]
-Will produce the following output
+__ratio__ is a general purpose utility inspired by Walter Brown allowing one to easily and safely compute rational values at compile time. The __ratio__ class catches all errors (such as divide by zero and overflow) at compile time. It is used in the __duration__ and __time_point__ classes to efficiently create units of time. It can also be used in other "quantity" libraries (both std-defined and user-defined), or anywhere there is a rational constant which is known at compile time. The use of this utility can greatly reduce the chances of run time overflow because the __ratio__ (and any ratios resulting from __ratio__ arithmetic) are always reduced to lowest terms.
- 0.006s
- 0.011s
- 0.017s
+__ratio__ is a template taking two intmax_ts, with the second defaulted to 1. In addition to copy constructors and assignement, it only has two public members, both of which are static const intmax_t. One is the numerator of the __ratio__ and the other is the denominator. The __ratio__ is always normalized such that it is expressed in lowest terms, and the denominator is always positive. When the numerator is 0, the denominator is always 1.
-[heading Stopwatches accumulation and statistics]
+[*Example:]
-The preceding stopwatch manage only with a measure. It is also interesting to have an statisitical view of these times, for example the sum, min, max and mean. `stopwatch_accumulator<>` associates an accumulator with a __stopwatch__, so we are able to retrieve any statistical feature Boost.Accumulator provides.
+ typedef __ratio__<5, 3> five_thirds; // five_thirds::num == 5, five_thirds::den == 3
+ typedef __ratio__<25, 15> also_five_thirds; // also_five_thirds::num == 5, also_five_thirds::den == 3
+ typedef ratio_divide<five_thirds, also_five_thirds>::type one; // one::num == 1, one::den == 1
-For example
+This facility also includes convenience typedefs for the SI prefixes `atto` through `exa` corresponding to their internationally recognized definitions (in terms of __ratio__). This is a tremendous syntactic convenience. It will prevent errors in specifying constants as one no longer has to double count the number of zeros when trying to write million or billion.
- using namespace boost::chrono;
- int f1(long j) {
- static stopwatch_reporter<stopwatch_accumulator<> > sw;
- stopwatch_reporter<stopwatch_accumulator<> >::scoped_run _(sw);
+[*Example:]
- for ( long i = 0; i < j; ++i )
- std::sqrt( 123.456L ); // burn some time
+ typedef ratio_multiply<__ratio__<5>, giga>::type _5giga; // _5giga::num == 5000000000, _5giga::den == 1
+ typedef ratio_multiply<__ratio__<5>, nano>::type _5nano; // _5nano::num == 1, _5nano::den == 200000000
- return 0;
- }
- int main() {
- f1(100000);
- f1(200000);
- f1(300000);
- return 0;
- }
+[endsect]
-Will produce the following output
+[section Duration]
- 3 times, sum=0.034s, min=0.006s, max=0.017s, mean=0.011s
+The __duration__ is the heart of this library. The interface that the user will see in everyday use is nearly identical to that of Boost.DateTime time __duration_s__ authored by Jeff Garland, both in syntax and in behavior. This has been a very popular boost library for 7 years. There is an enormous positive history with this interface.
+The library consists of six units of time __duration__:
-[heading Wall clock versus system and user time]
+* __hours__
+* __minutes__
+* __seconds__
+* __milliseconds__
+* __microseconds__
+* __nanoseconds__
-It is also helpful if such timing information is broken down into real (wall clock) time, CPU time spent by the user, and CPU time spent by the operating system servicing user requests.
+These units were chosen as a subset of the boost library because they are the most common units used when sleeping, waiting on a condition variable, or waiting to obtain the lock on a mutex. Each of these units is nothing but a thin wrapper around a signed integral count. That is, when you construct `minutes(3)`, all that happens is a `3` is stored inside of minutes. When you construct `microseconds(3)`, all that happens is a `3` is stored inside of microseconds.
-__Boost_Chrono__ provides 3 concrete process clocks:
+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.
-# `process_real_CPU_clock`,
-# `process_user_CPU_clock`,
-# `process_system_CPU_clock`
+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.
-providing a thin wrappers around the operating system's process timer API. For POSIX-like systems, that's the times() function, while for Windows, it's the GetProcessTimes() function.
+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.
-These clocks capture the specific time unitarily. __Boost_Chrono__ provides also a clock `process_cpu_clock` that captures the three times at once.
+A secondary benefit is that by publishing the class template __duration__ interface, user code can very easily create __duration_s__ with any precision they desire. The __ratio__ utility is used to specify the precision, so as long as the precision can be expressed by a rational constant with respect to seconds, this framework can exactly represent it (one third of a second is no problem, and neither is one third of a `femto` second). All of this utility and flexibility comes at no cost just by making use of the no-run-time-overhead __ratio__ facility.
- using namespace boost::chrono;
- int main()
- {
- stopwatch_reporter<stopwatch<process_cpu_clock> > _;
- // ...
- }
+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.
-Will produce the following output
+__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.
- real 0.034s, cpu 0.031s (93.0%), user 0.031s, system 0.000s
-As this is one of the expression more commonly use, the library provides a stopclock shortcut so the preceding can be writen as
+[section So What Exactly is a `duration` and How Do I Use One?]
- using namespace boost::chrono;
- int main()
- {
- stopclock<> _;
- // ...
- }
+A __duration__ has a representation and a tick period (precision).
+ template <class Rep, class Period = __ratio__<1> > class duration;
-[heading How reliable are these measures?]
+The representation is simply any arithmetic type, or an emulation of such a type. The representation stores a count of ticks. This count is the only data member stored in a __duration__. If the representation is floating point, it can store fractions of a tick to the precision of the representation. The tick period is represented by a __ratio__ and is encoded into the __duration__'s type, instead of stored. The tick period only has an impact on the behavior of the __duration__ when a conversion between different __duration__'s is attempted. The tick period is completely ignored when simply doing arithmetic among like __duration_s__.
-[note this section need to be reworked, the ideas are there, but ...]
+[*Example:]
-There are three context on which you can get unreliable measures:
+ typedef __duration__<long, __ratio__<60> > minutes;
+ minutes m1(3); // m1 stores 3
+ minutes m2(2); // m2 stores 2
+ minutes m3 = m1 + m2; // m3 stores 5
-* Precission of your clock. If the precission of your clock is 10ms you can not be able to measure the time spent by blocks of code that takes the same order of magnitude. The library provides a hig_resolution_clock that gives you the higher resolution available on your platform. Respect to the precission, nothing to do except to take the clock with the highest resolution and measures blocks of code that will spent time having more than one order of magnitude the precission of the clock.
+ typedef __duration__<long long, micro> microseconds;
+ microseconds us1(3); // us1 stores 3
+ microseconds us2(2); // us2 stores 2
+ microseconds us3 = us1 + us2; // us3 stores 5
-``
-#include <boost/chrono/chrono.hpp>
- ...
- stopclock<high_resolution_clock> _;
-``
+ microseconds us4 = m3 + us3; // us4 stores 300000005
-* When your application is multithreaded, and you use a process clock, the time you get is the delay during which your block has been executed, in concurrency with the other threads of execution. If what you want is the time spent by this specific thread another clock is needed. The library provide a __thread_clock__ that returns the time spent by the thread on platforms providing this kind of data. It can be used as follows
+In the final line of code above, there is an implicit conversion from minutes to microseconds, resulting in a relatively large number of microseconds.
-``
-#include <boost/chrono/thread_clock.hpp>
-...
-#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
- stopclock<thread_clock> _;
-#else
- stopclock<process_real_cpu_clock> _;
-#endif
-``
+If you need to access the tick count within a __duration__, there is a member `count()` which simply returns the stored tick count.
-* Nested stopclocks (usually nested function calls where each function contains a stopclock). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
+ long long tc = us4.count(); // tc is 300000005
-Some measures let us think that most of the time spent by the stopclock mechanism is associated to the logging part. There are two things we can do to make the difference :
+These __duration_s__ have very simple, very predictable, and very observable behavior. After all, this is really nothing but the time tested interface of Jeff's boost time __duration__ library (unified with templates instead of inheritance).
-* Avoid expensive operations as logging while doing the measures. Note that reporting in itself is not too expensive as far as we don't need to flush the buffer. This can be achieved either using a stopclock accumulator, 'i.e. don't report until all the measures have been compiled and then report some statistics or using an asynchronous stream.
+[endsect]
-* Introduce some cheap mechanism that allows us to make the difference between the application time and the intrinsec stopclock time. When the precission of the clock is enough, we can suspend the counting of the Clock while we are spending time reporting the measures, and resume it once the work is done. The library provide a Clock wrapper __suspendible_clock__ that make the resulting clock suspendible. The stopwatch_reporter is able to detect if the CLock is Suspendible and then suspend/resume the clock while doing the report.
+[section What happens if I assign `m3 + us3` to `minutes` instead of `microseconds`?]
- stopclock<suspendible_clock<Clock> > _;
+ minutes m4 = m3 + us3;
+It won't compile. The rationale is that implicit truncation error should not be allowed to happen. If this were to compile, then `m4` would hold `5`, the same value as `m3`. The value associated with `us3` has been effectively ignored. This is similar to the problem of assigning a double to an `int`: the fractional part gets silently discarded.
-See the performances section for more deep details.
+[heading But what if the truncation behavior is what I want to do?]
-[endsect]
-[endsect]
+There is a __duration_cast__ facility to explicitly ask for this behavior:
-[section:caveat Caveat emptor]
+ minutes m4 = __duration_cast__<minutes>(m3 + us3); // m4.count() == 5
-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.
+In general, one can perform __duration__ arithmetic at will. If __duration_cast__ isn't used, and it compiles, the arithmetic is exact. Any place one wants to override this exact arithmetic behavior, __duration_cast__ can be used to explicitly specify that desire. The __duration_cast__ has the same efficiency as the implicit conversion, and will even be exact as often as it can.
[endsect]
-[endsect]
-
-
-[/==============================]
-[section:users_guide Users'Guide]
-[/==============================]
-[/======================================]
-[section:getting_started Getting Started]
-[/======================================]
+[section I'm trafficking in floating point `duration`s. I don't want to deal with writing `duration_cast` all over the place. I'm content with the precision of my floating point representation]
-[/======================================]
-[section:install Installing Chrono]
-[/======================================]
+Not a problem. When the destination of a conversion has floating point representation, all conversions are allowed to happen implicitly.
-[/=================================]
-[heading Getting __Boost_Chrono__ ]
-[/=================================]
+ typedef __duration__<double, __ratio__<60> > dminutes;
+ dminutes dm4 = m3 + us3; // dm4.count() == 5.000000083333333
-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]
+[endsect]
-You can also access the latest (unstable?) state from the [@https://svn.boost.org/svn/boost/sandbox/chrono Boost Sandbox]. Just go to [@http://svn.boost.org/trac/boost/wiki/BoostSubversion here] and follow the instructions there for anonymous SVN access.
+[section How expensive is all of this?]
-[/==========================================]
-[heading Where to install __Boost_Chrono__? ]
-[/==========================================]
+If you were writing these conversions by hand, you could not make it more efficient. The use of __ratio__ ensures that all conversion constants are simplified as much as possible at compile time. This usually results in the numerator or denominator of the conversion factor simplifying to `1`, and being subsequently ignored in converting the run time values of the tick counts.
-The simple way is to decompress (or checkout from SVN) the file in your BOOST_ROOT directory.
+[endsect]
-Othesewise, if you decompress in a different directory, you will need to comment some lines, and uncomment and change others in the build/Jamfile and test/Jamfile. Sorry for this, but I have not reached yet to write a Jamfile that is able to work in both environements and use the BOOST_ROOT variable. Any help is welcome.
+[section How complicated is it to build a function taking a `duration` parameter?]
-[/=================================]
-[heading Building __Boost_Chrono__ ]
-[/=================================]
+There are several options open to the user:
-__Boost_Chrono__ is not a header only library. You need to compile it before use.
+* If the author of the function wants to accept any __duration__, and is willing to work in floating point __duration_s__, he can simply use any floating point __duration__ as the parameter:
- bjam libs/chrono/build
+ void f(duration<double> d) // accept floating point seconds
+ {
+ // d.count() == 3.e-6 when passed microseconds(3)
+ }
-[/===================]
-[heading Requirements]
-[/===================]
+ f(microseconds(3));
-[*Boost.Chrono] 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 versions should works also).
+* If the author of the function wants to traffic only in integral __duration_s__, and is content with handling nothing finer than say nanoseconds (just as an example), he can simply specify nanoseconds as the parameter:
-In particular, __Boost_Chrono__ depends on:
+ void f(nanoseconds d)
+ {
+ // d.count() == 3000 when passed microseconds(3)
+ }
-[variablelist
-[
- [[@http://www.boost.org/libs/config [*Boost.Config]]] [for configuration purposes, ...]
-]
-[
- [[@http://www.boost.org/libs/exception [*Boost.Exception]]] [for throw_exception, ...]
-]
-[
- [[@http://www.boost.org/libs/integer [*Boost.Integer]]] [for cstdint conformance, ...]
-]
-[
- [[@http://www.boost.org/libs/system [*Boost.System]]] [for error_code, ...]
-]
-[
- [[@http://www.boost.org/libs/type_traits [*Boost.TypeTraits]]] [for is_base, ...]
-]
-[
- [[@http://www.boost.org/libs/utility [*Boost.UtiliTy/EnableIf]]] [for enable_if, ...]
-]
-]
+ f(microseconds(3));
-__Boost_Chrono__ depends optionaly on:
+In this design, if the client wants to pass in a floating point __duration__, or a __duration__ of finer precision than nanoseconds, then the client is responsible for choosing his own rounding mode in the conversion to nanoseconds.
-[variablelist
-[
- [[@http://www.boost.org/libs/accumulator [*Boost.Accumulator]]] [for accumulator_set, and statistics features when stopwatch_accumulator.hpp is included]
-]
-[
- [[@http://www.boost.org/libs/thread [*Boost.Thread]]] [for thread_specific_ptr when suspendible_clock.hpp is included]
-]
-[
- [[@http://www.boost.org/libs/typeof [*Boost.Typeof]]] [for duration and time_point registration when typeof/boost/chrono/chrono.hpp is include]
-]
-]
+ __duration__<double> s(1./3); // 1/3 of a second
+ f(duration_cast<nanoseconds>(s)); // round towards zero in conversion to nanoseconds
+In the example above, the client of f has chosen "round towards zero" as the desired rounding mode to nanoseconds. If the client has a __duration__ that won't exactly convert to nanoseconds, and fails to choose how the conversion will take place, the compiler will refuse the call:
-[/=========================================================]
-[heading Building an executable that uses __Boost_Chrono__ ]
-[/=========================================================]
+ f(s); // does not compile
-In addition to link with the Boost Chrono library you need also to link with the Boost System library.
+* If the author of the function wants to accept any __duration__, but wants to work with integral representations and wants to control the rounding mode internally, then he can template the function:
-[/=========================]
-[heading Exceptions safety ]
-[/=========================]
+ template <class Rep, class Period>
+ void f(__duration__<Rep, Period> d)
+ {
+ // convert d to nanoseconds, rounding up if it is not an exact conversion
+ nanoseconds ns = duration_cast<nanoseconds>(d);
+ if (ns < d)
+ ++ns;
+ // ns.count() == 333333334 when passed 1/3 of a floating point second
+ }
-All functions in the library are exception-neutral and provide strong guarantee of exception safety as long as the underlying parameters provide it.
+ f(__duration__<double>(1./3));
-[/=====================]
-[heading Thread safety ]
-[/=====================]
+* If the author in the example does not want to accept floating point based __duration_s__, he can enforce that behavior like so:
-All functions in the library are thread-unsafe except when noted explicitly.
+ template <class Period>
+ void f(__duration__<long long, Period> d)
+ {
+ // convert d to nanoseconds, rounding up if it is not an exact conversion
+ nanoseconds ns = duration_cast<nanoseconds>(d);
+ if (ns < d)
+ ++ns;
+ // ns.count() == 333333334 when passed 333333333333 picoseconds
+ }
-[/========================]
-[heading Tested compilers ]
-[/========================]
+ f(__duration__<long long, pico>(333333333333)); // About 1/3 of a second worth of picoseconds
-The implementation will eventually work with most C++03 conforming compilers.
-Current version has been tested on:
+Clients with floating point __duration_s__ who want to use f will now have to convert to an integral __duration__ themselves before passing the result to f.
-Windows with
+In summary, the author of f has quite a bit of flexibility and control in the interface he wants to provide his clients with, and easy options for manipulating that __duration__ internal to his function.
-* MSVC 10.0
-* MSVC 9.0 Express
-* MSVC 8.0
+[endsect]
+[endsect]
-[/* Intel 11.0]
+[section Clocks]
-Scientific Linux with
+While __duration_s__ only have precision and representation to concern themselves, clocks and __time_point_s__ are intimately related and refer to one another. Because clocks are simpler to explain, we will do so first without fully explaining __time_point_s__. Once clocks are introduced, it will be easier to then fill in what a __time_point__ is.
-* GCC 4.1.2
+A clock is a concept which bundles 3 things:
-Cygwin with
+# A concrete __duration__ type.
+# A concrete __time_point__ type.
+# A function called now() which returns the concrete __time_point__.
-* GCC 3.4.4
-* GCC 4.3.2
+__Boost_Chrono__ provides the standard concrete clocks:
-MinGW with
+# system_clock
+# monotonic_clock
+# high_precision_clock
-* GCC 4.4.0
+A given platform may not be able to supply all three of these clocks. The user is also able to easily create more clocks.
-Initial version was tested on:
+Given a clock named Clock, it will have:
-MacOS with GCC 4.2.4
+ class Clock {
+ public:
+ typedef an arithmetic-like type rep;
+ typedef an instantiation of ratio period;
+ typedef boost::chrono::__duration__<rep, period> __duration__;
+ typedef boost::chrono::__time_point__<Clock> time_point;
+ static const bool is_monotonic = true or false;
-Ubuntu Linux with GCC 4.2.4
+ static time_point now();
+ };
-[note Please let us know how this works on other platforms/compilers.]
+One can get the current time from Clock with:
-[note Please send any questions, comments and bug reports to boost <at> lists <dot> boost <dot> org.]
+ Clock::time_point t1 = Clock::now();
-[endsect]
-[/====================]
-[section Hello World! ]
-[/====================]
+And one can get the time __duration__ between two __time_point_s__ associated with Clock with:
-If all you want to do is to time a program's execution:
+ Clock::duration d = t1 - Clock::now();
- #include <boost/chrono/stopclock.hpp>
+And one can specify a past or future __time_point__ with:
- ...
+ Clock::time_point t2 = Clock::now() + d;
- // add this in the scope you want to time,
- // at the point you want the timer to start.
- boost::chrono::stopclock<> rt;
+Note how even if a particular clock becomes obsolete, the next clock in line will have the same API. There is no new learning curve to come up. The only source code changes will be simply changing the type of the clock. The same __duration__ and __time_point__ framework continues to work as new clocks are introduced. And multiple clocks are safely and easily handled within the same program.
-Here is a complete program (stopclock_example.cpp):
+[endsect]
- #include <boost/chrono/stopclock.hpp>
- #include <cmath>
- int main()
- {
- boost::chrono::stopclock<> t;
+[section Time Point]
- for ( long i = 0; i < 10000000; ++i )
- std::sqrt( 123.456L ); // burn some time
+A __time_point__ represents a point in time, as opposed to a __duration__ of time. Another way of saying the same thing, is that a __time_point__ represents an epoch plus or minus a __duration__. Examples of __time_point_s__ include:
- return 0;
- }
+* 3 minutes after the computer booted.
+* 03:14:07 UTC on Tuesday, January 19, 2038
+* 20 milliseconds after I started that timer.
-Debug build output was:
+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.
- real 0.832s, cpu 0.813s (97.7%), user 0.813s, system 0.000s
+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 other words, the program took 0.832 real-time (i.e. wall clock) seconds to execute, while the operating system (Windows in this case) charged 0.813 seconds of CPU time to the user and 0 seconds to the system. The total CPU time reported was 0.813 seconds, and that represented utilization of 97.7% of the real-time seconds.
+[section So What Exactly is a `time_point` and How Do I Use One?]
-[endsect]
+A __time_point__ has a clock and a __duration__.
-[endsect]
+ template <class Clock, class Duration = typename Clock::duration> class time_point;
-[section Tutorial]
+The __time_point__'s clock is not stored. It is simply embedded into the __time_point__'s type and serves two purposes:
-[note If you have not read yet the [@boost_chrono/overview/motivation.html motivation section], please read it now.]
+# Because __time_point_s__ originating from different clocks have different types, the compiler can be instructed to fail if incompatible __time_point_s__ are used in inappropriate ways.
+# Given a __time_point__, one often needs to compare that __time_point__ to "now". This is very simple as long as the __time_point__ knows what clock it is defined with respect to.
-[section Common Type]
+A __time_point__'s __duration__ is stored as the only data member of the __time_point__. Thus __time_point_s__ and their corresponding __duration__ have exactly the same layout. But they have very different meanings. For example, it is one thing to say I want to sleep for 3 minutes. It is a completely different thing to say I want to sleep until 3 minutes past the time I started that timer (unless you just happened to start that timer now). Both meanings (and options for sleeping) have great practical value in common use cases for sleeping, waiting on a condition variable, and waiting for a mutex's lock. These same concepts and tools are found (for example) in Ada.
-[section How to get the common type of inter-type with explicit conversions?]
+A timer example:
-The default definition of __common_type__ demands the conversion be implicit. However the trait can be specialized for user-defined types which want to limit their inter-type conversions to explicit, and yet still want to interoperate with the __common_type__ facility.
+ void f()
+ {
+ monotonic_clock::time_point start = monotonic_clock::now();
+ g();
+ h();
+ __duration__<double> sec = monotonic_clock::now() - start;
+ cout << "f() took " << sec.count() << " seconds\n";
+ }
+Note that if one is using the __duration__ between two clock __time_point_s__ in a way where the precision of the __duration__ matters, it is good practice to convert the clock's native __duration__ to a known __duration__. This insulates the code from future changes which may be made to the clock's native precision in the future. For example monotonic_clock could easily be based on the clock speed of the cpu. When you upgrade to a faster machine, you do not want your code that assumed a certain tick period of this clock to start experiencing run time failures because your timing code has silently changed meaning.
+A delay loop example:
-[endsect]
-[endsect]
+ // delay for at least 500 nanoseconds:
+ auto go = monotonic_clock::now() + nanoseconds(500);
+ while (monotonic_clock::now() < go)
+ ;
-[section Ratio]
-[endsect]
+The above code will delay as close as possible to half a microsecond, no matter what the precision of monotonic_clock is. The more precise __monotonic_clock__ becomes, the more accurate will be the delay to 500 nanoseconds.
-[section Clocks, time_point and duration]
+[endsect]
-[section How to get the actual CPU milliseconds (or other units?) used by the current thread between end and start?]
+[section How to get the actual CPU milliseconds (or other units?) used by the current thread between end and start?]
-You can use __duration_cast__<> to convert the `thread_clock::duration` into whatever units you desire. This facility will round down (truncate) if an exact conversion is not possible. Ex:
+You can use __duration_cast__`<>` to convert the `thread_clock::duration` into whatever units you desire. This facility will round down (truncate) if an exact conversion is not possible. Ex:
typedef boost::chrono::milliseconds ms;
ms d = boost::chrono::duration_cast<ms>(end - start);
@@ -872,27 +899,27 @@
std::cout << ms.count() << "ms\n";
-As `boost::chrono::thread_clock::duration` is nanoseconds, we can convert to __nanoseconds__, or some integral-based duration which __nanoseconds__ will always exactly convert to, then __duration_cast__<> is unnecessary:
+As `boost::chrono::thread_clock::duration` is nanoseconds, we can convert to __nanoseconds__, or some integral-based duration which __nanoseconds__ will always exactly convert to, then __duration_cast__`<>` is unnecessary:
typedef boost::chrono::nanoseconds ns;
ns d = end - start;
std::cout << ns.count() << "ns\n";
-If you need seconds with a floating point representation you can also eliminate the __duration_cast_<>:
+If you need seconds with a floating point representation you can also eliminate the __duration_cast_`<>`:
- typedef boost::chrono::duration<double> sec; // seconds, stored with a double
+ typedef boost::chrono::__duration__<double> sec; // seconds, stored with a double
sec d = end - start;
std::cout << sec.count() << "s\n";
-If you're not sure if you need __duration_cast__<> or not, feel free to try it without. If the conversion is exact, or if the destination has a floating point representation, it will compile. Else it will not compile.
+If you're not sure if you need __duration_cast__`<>` or not, feel free to try it without. If the conversion is exact, or if the destination has a floating point representation, it will compile. Else it will not compile.
-If you would like to programmatically inspect `thread_clock::duration`, you can get the representation type with `thread_clock::rep`, and the tick period with `thread_clock::period` (which should be a type __ratio__ which has nested values `ratio::num` and `ratio::den`). The tick period of __thread_clock__ is `thread_clock::period::num / thread_clock::period::den` seconds: 1/1000000000 in this case (1 billionth of a second), stored in a long long.
+If you would like to programmatically inspect `thread_clock::duration`, you can get the representation type with `thread_clock::rep`, and the tick period with `thread_clock::period` (which should be a type __ratio__ which has nested values `__ratio__::num` and `__ratio__::den`). The tick period of __thread_clock__ is `thread_clock::period::num / thread_clock::period::den` seconds: 1/1000000000 in this case (1 billionth of a second), stored in a long long.
-If you need to use __duration_cast__<>, but want to round up, instead of down when the conversion is inexact, here is a handy little helper function to do so. Writing it is actually a good starter project for understanding chrono:
+If you need to use __duration_cast__`<>`, but want to round up, instead of down when the conversion is inexact, here is a handy little helper function to do so. Writing it is actually a good starter project for understanding chrono:
template <class ToDuration, Rep, Period>
ToDuration
- round_up(boost::chrono::duration<Rep, Period> d)
+ round_up(boost::chrono::__duration__<Rep, Period> d)
{
// first round down
ToDuration result = boost::chrono::duration_cast<ToDuration>(d);
@@ -918,7 +945,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<thread_clock> time_point;
+ typedef chrono::__time_point__<thread_clock> time_point;
static const bool is_monotonic = BOOST_CHRONO_THREAD_CLOCK_IS_MONOTONIC;
static time_point now( ) {
@@ -966,8 +993,113 @@
[endsect]
+
[section Stopwatches and Stopclocks]
+Knowing how long a program, a function or a specific block takes to execute is useful in both test and production environments.
+__Boost_Chrono__ introduces the __Stopwatch__ concept which captures the mechanism to measure the elapsed time.
+A Stopwatch allows to start, stop, suspend and resume the measure of the eleapsed time.
+__stopwatch__`<>` is the basic model of __Stopwatch__ allowing to make a single measure.
+
+At the user level, the main use case of measuring the elapsed time is to report these measures on the display.
+__stopwatch_reporter__`<>` provides a run time reporting package that can be invoked in a single line of code to report the usage of a Clock.
+For example
+
+ using namespace boost::chrono;
+ int f1(long j) {
+ stopwatch_reporter<stopwatch<> > _;
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+ int main() {
+ f1(100000);
+ f1(200000);
+ f1(300000);
+ return 0;
+ }
+
+Will produce the following output
+
+ 0.006s
+ 0.011s
+ 0.017s
+
+
+[section Stopwatches accumulation and statistics]
+
+The preceding stopwatch manage only with a measure. It is also interesting to have an statisitical view of these times, for example the sum, min, max and mean. __stopwatch_accumulator__`<>` associates an accumulator with a __stopwatch__, so we are able to retrieve any statistical feature Boost.Accumulator provides.
+
+For example
+
+ using namespace boost::chrono;
+ int f1(long j) {
+ static stopwatch_reporter<stopwatch_accumulator<> > sw;
+ stopwatch_reporter<stopwatch_accumulator<> >::scoped_run _(sw);
+
+ for ( long i = 0; i < j; ++i )
+ std::sqrt( 123.456L ); // burn some time
+
+ return 0;
+ }
+ int main() {
+ f1(100000);
+ f1(200000);
+ f1(300000);
+ return 0;
+ }
+
+Will produce the following output
+
+ 3 times, sum=0.034s, min=0.006s, max=0.017s, mean=0.011s
+
+
+[endsect]
+
+[
+[section How reliable are these measures?]
+
+[note this section need to be reworked, the ideas are there, but ...]
+
+There are three context on which you can get unreliable measures:
+
+* Precission of your clock. If the precission of your clock is 10ms you can not be able to measure the time spent by blocks of code that takes the same order of magnitude. The library provides a hig_resolution_clock that gives you the higher resolution available on your platform. Respect to the precission, nothing to do except to take the clock with the highest resolution and measures blocks of code that will spent time having more than one order of magnitude the precission of the clock.
+
+``
+#include <boost/chrono/chrono.hpp>
+ ...
+ stopclock<high_resolution_clock> _;
+``
+
+* When your application is multithreaded, and you use a process clock, the time you get is the delay during which your block has been executed, in concurrency with the other threads of execution. If what you want is the time spent by this specific thread another clock is needed. The library provide a __thread_clock__ that returns the time spent by the thread on platforms providing this kind of data. It can be used as follows
+
+``
+#include <boost/chrono/thread_clock.hpp>
+...
+#if defined(BOOST_CHRONO_HAS_THREAD_CLOCK)
+ stopclock<thread_clock> _;
+#else
+ stopclock<process_real_cpu_clock> _;
+#endif
+``
+
+* Nested stopclocks (usually nested function calls where each function contains a stopclock). When the nesting is deep enough, the cumulative overhead of all the stopclock functionality make the data unreliable except for the inner-most trace points. The question is, how much time is related to the application code we want to measure and how much to the fact we are meassuring and logging in inner blocks?
+
+Some measures let us think that most of the time spent by the stopclock mechanism is associated to the logging part. There are two things we can do to make the difference :
+
+* Avoid expensive operations as logging while doing the measures. Note that reporting in itself is not too expensive as far as we don't need to flush the buffer. This can be achieved either using a stopclock accumulator, 'i.e. don't report until all the measures have been compiled and then report some statistics or using an asynchronous stream.
+
+* Introduce some cheap mechanism that allows us to make the difference between the application time and the intrinsec stopclock time. When the precission of the clock is enough, we can suspend the counting of the Clock while we are spending time reporting the measures, and resume it once the work is done. The library provide a Clock wrapper __suspendible_clock__ that make the resulting clock suspendible. The stopwatch_reporter is able to detect if the CLock is Suspendible and then suspend/resume the clock while doing the report.
+
+ stopclock<suspendible_clock<Clock> > _;
+
+
+See the performances section for more deep details.
+[endsect]
+]
+
[section How can I prefix each report with `BOOST_CURRENT_FUNCTION` function signature?]
You will need to give a specific format to your stopclock. You just need to concatenate your specific pattern to the default_format of the formatter.
@@ -1114,6 +1246,7 @@
[endsect]
+
[section Formatters]
[section How can I make a specific formatter when the default do not satisfy my expectations]
@@ -1133,7 +1266,7 @@
>
>::reporter my_stopwatch_accumulator_reporter;
-But what happens if we add new statistics to the accumulator_set that are not taken in account by the default formatter? These statistics will simply be ignored. So we will need to define own own accumulator formatter.
+But what happens if we add new statistics to the accumulator_set that are not taken in account by the default formatter? These statistics will simply be ignored. So we will need to define our own accumulator formatter.
typedef stopwatch_accumulator<process_real_cpu_clock,
accumulator_set<process_real_cpu_clock::rep,
@@ -1185,7 +1318,7 @@
break;
case 'a':
os << (accumulators::count(acc)>0)
- ? boost::chrono::duration<double>(duration_t(
+ ? boost::chrono::__duration__<double>(duration_t(
duration_t::rep(accumulators::mean(acc)))).count()
: 0;
break;
@@ -1194,7 +1327,7 @@
break;
case 'v':
os << (accumulators::count(acc)>0)
- ? boost::chrono::duration<double>(duration_t(
+ ? boost::chrono::__duration__<double>(duration_t(
duration_t::rep(accumulators::variance(acc)))).count()
: 0;
break;
@@ -1211,21 +1344,51 @@
[endsect]
[endsect]
+
+
[endsect]
[/===============]
[section Examples]
[/===============]
-[section Clocks]
+[section Common type]
+
+[/==================]
+[section min utility]
+
+Returns the earliest time_point.
+
+ template <class Clock, class Duration1, class Duration2>
+ typename boost::__common_type__<__time_point__<Clock, Duration1>,
+ __time_point__<Clock, Duration2> >::type
+ min(__time_point__<Clock, Duration1> t1, __time_point__<Clock, Duration2> t2)
+ {
+ return t2 < t1 ? t2 : t1;
+ }
+
+Being able to *easily* write this function is a major feature!
+
+ BOOST_AUTO(t1, system_clock::now() + seconds(3));
+ BOOST_AUTO(t2, system_clock::now() + nanoseconds(3));
+ BOOST_AUTO(t3, (min)(t1, t2));
+
+['See the source file [@../../example/min_time_point.cpp example/min_time_point.cpp]]
+
+
+[endsect]
+
+[endsect]
+
+[section Ratio]
[/===============]
[section SI-units]
[/===============]
-Type-safe "physics" code interoperating with boost::chrono::duration types and taking advantage of the boost::ratio infrastructure and design philosophy.
+Type-safe "physics" code interoperating with boost::chrono::__duration__ types and taking advantage of the boost::__ratio__ infrastructure and design philosophy.
-length - mimics boost::chrono::duration except restricts representation to double.
-Uses boost::ratio facilities for length units conversions.
+length - mimics boost::chrono::__duration__ except restricts representation to double.
+Uses boost::__ratio__ facilities for length units conversions.
template <class Ratio>
class length {
@@ -1256,25 +1419,25 @@
Sparse sampling of length units
- typedef length<boost::ratio<1> > meter; // set meter as "unity"
+ typedef length<boost::__ratio__<1> > meter; // set meter as "unity"
typedef length<boost::centi> centimeter; // 1/100 meter
typedef length<boost::kilo> kilometer; // 1000 meters
- typedef length<boost::ratio<254, 10000> > inch; // 254/10000 meters
+ typedef length<boost::__ratio__<254, 10000> > inch; // 254/10000 meters
-length takes ratio instead of two integral types so that definitions can be made like so:
+length takes __ratio__ instead of two integral types so that definitions can be made like so:
- typedef length<boost::ratio_multiply<boost::ratio<12>, inch::ratio>::type> foot; // 12 inchs
- typedef length<boost::ratio_multiply<boost::ratio<5280>, foot::ratio>::type> mile; // 5280 feet
+ typedef length<boost::ratio_multiply<boost::__ratio__<12>, inch::__ratio__>::type> foot; // 12 inchs
+ typedef length<boost::ratio_multiply<boost::__ratio__<5280>, foot::__ratio__>::type> mile; // 5280 feet
Need a floating point definition of seconds
- typedef boost::chrono::duration<double> seconds; // unity
+ typedef boost::chrono::__duration__<double> seconds; // unity
Demo of (scientific) support for sub-nanosecond resolutions
- typedef boost::chrono::duration<double, boost::pico> picosecond; // 10^-12 seconds
- typedef boost::chrono::duration<double, boost::femto> femtosecond; // 10^-15 seconds
- typedef boost::chrono::duration<double, boost::atto> attosecond; // 10^-18 seconds
+ typedef boost::chrono::__duration__<double, boost::pico> picosecond; // 10^-12 seconds
+ typedef boost::chrono::__duration__<double, boost::femto> femtosecond; // 10^-15 seconds
+ typedef boost::chrono::__duration__<double, boost::atto> attosecond; // 10^-18 seconds
A very brief proof-of-concept for SIUnits-like library. Hard-wired to floating point seconds and meters, but accepts other units.
@@ -1292,7 +1455,7 @@
};
template <>
- class quantity<boost::ratio<1>, boost::ratio<0> >
+ class quantity<boost::__ratio__<1>, boost::__ratio__<0> >
{
double q_;
public:
@@ -1304,7 +1467,7 @@
};
template <>
- class quantity<boost::ratio<0>, boost::ratio<1> >
+ class quantity<boost::__ratio__<0>, boost::__ratio__<1> >
{
double q_;
public:
@@ -1316,7 +1479,7 @@
};
template <>
- class quantity<boost::ratio<0>, boost::ratio<0> >
+ class quantity<boost::__ratio__<0>, boost::__ratio__<0> >
{
double q_;
public:
@@ -1329,11 +1492,11 @@
Example of SI-Units
- typedef quantity<boost::ratio<0>, boost::ratio<0> > Scalar;
- typedef quantity<boost::ratio<1>, boost::ratio<0> > Time; // second
- typedef quantity<boost::ratio<0>, boost::ratio<1> > Distance; // meter
- typedef quantity<boost::ratio<-1>, boost::ratio<1> > Speed; // meter/second
- typedef quantity<boost::ratio<-2>, boost::ratio<1> > Acceleration; // meter/second^2
+ typedef quantity<boost::__ratio__<0>, boost::__ratio__<0> > Scalar;
+ typedef quantity<boost::__ratio__<1>, boost::__ratio__<0> > Time; // second
+ typedef quantity<boost::__ratio__<0>, boost::__ratio__<1> > Distance; // meter
+ typedef quantity<boost::__ratio__<-1>, boost::__ratio__<1> > Speed; // meter/second
+ typedef quantity<boost::__ratio__<-2>, boost::__ratio__<1> > Acceleration; // meter/second^2
Quantity arithmetics
@@ -1395,10 +1558,10 @@
int main()
{
- typedef boost::ratio<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
- typedef boost::ratio<3, BOOST_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__<8, BOOST_INTMAX_C(0x7FFFFFFFD)> R1;
+ typedef boost::__ratio__<3, BOOST_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';
@@ -1445,6 +1608,8 @@
[endsect]
[endsect]
+[section Duation]
+
[/===============]
[section How you override the duration's default constructor]
@@ -1489,12 +1654,12 @@
friend bool operator>=(zero_default x, zero_default y) {return !(x < y);}
};
- typedef boost::chrono::duration<zero_default<long long>, boost::nano > nanoseconds;
- typedef boost::chrono::duration<zero_default<long long>, boost::micro > microseconds;
- typedef boost::chrono::duration<zero_default<long long>, boost::milli > milliseconds;
- typedef boost::chrono::duration<zero_default<long long> > seconds;
- typedef boost::chrono::duration<zero_default<long long>, boost::ratio<60> > minutes;
- typedef boost::chrono::duration<zero_default<long long>, boost::ratio<3600> > hours;
+ typedef boost::chrono::__duration__<zero_default<long long>, boost::nano > nanoseconds;
+ typedef boost::chrono::__duration__<zero_default<long long>, boost::micro > microseconds;
+ typedef boost::chrono::__duration__<zero_default<long long>, boost::milli > milliseconds;
+ typedef boost::chrono::__duration__<zero_default<long long> > seconds;
+ typedef boost::chrono::__duration__<zero_default<long long>, boost::__ratio__<60> > minutes;
+ typedef boost::chrono::__duration__<zero_default<long long>, boost::__ratio__<3600> > hours;
}
Usage
@@ -1508,29 +1673,81 @@
[endsect]
-[/==================]
-[section min utility]
+[/=========================]
+[section runtime_resolution]
-Returns the earliest time_point.
+Handle duration with resolution not known until run time
- template <class Clock, class Duration1, class Duration2>
- typename boost::common_type<time_point<Clock, Duration1>,
- time_point<Clock, Duration2> >::type
- min(time_point<Clock, Duration1> t1, time_point<Clock, Duration2> t2)
+ class duration
{
- return t2 < t1 ? t2 : t1;
- }
+ public:
+ typedef long long rep;
+ private:
+ rep rep_;
-Being able to *easily* write this function is a major feature!
+ static const double ticks_per_nanosecond;
+
+ public:
+ typedef boost::chrono::duration<double, boost::nano> tonanosec;
+
+ duration() {} // = default;
+ explicit duration(const rep& r) : rep_(r) {}
+
+ // conversions
+ explicit duration(const tonanosec& d)
+ : rep_(static_cast<rep>(d.count() * ticks_per_nanosecond)) {}
+
+ // explicit
+ operator tonanosec() const {return tonanosec(rep_/ticks_per_nanosecond);}
+
+ // observer
+
+ rep count() const {return rep_;}
+
+ // arithmetic
+
+ duration& operator+=(const duration& d) {rep_ += d.rep_; return *this;}
+ duration& operator-=(const duration& d) {rep_ += d.rep_; return *this;}
+ duration& operator*=(rep rhs) {rep_ *= rhs; return *this;}
+ duration& operator/=(rep rhs) {rep_ /= rhs; return *this;}
+
+ duration operator+() const {return *this;}
+ duration operator-() const {return duration(-rep_);}
+ duration& operator++() {++rep_; return *this;}
+ duration operator++(int) {return duration(rep_++);}
+ duration& operator--() {--rep_; return *this;}
+ duration operator--(int) {return duration(rep_--);}
+
+ friend duration operator+(duration x, duration y) {return x += y;}
+ friend duration operator-(duration x, duration y) {return x -= y;}
+ friend duration operator*(duration x, rep y) {return x *= y;}
+ friend duration operator*(rep x, duration y) {return y *= x;}
+ friend duration operator/(duration x, rep y) {return x /= y;}
+
+ friend bool operator==(duration x, duration y) {return x.rep_ == y.rep_;}
+ friend bool operator!=(duration x, duration y) {return !(x == y);}
+ friend bool operator< (duration x, duration y) {return x.rep_ < y.rep_;}
+ friend bool operator<=(duration x, duration y) {return !(y < x);}
+ friend bool operator> (duration x, duration y) {return y < x;}
+ friend bool operator>=(duration x, duration y) {return !(x < y);}
+ };
+
+['See the source file [@../../example/runtime_resolution.cpp here]]
+
+[endsect]
+
+[/================]
+[section Saturating]
+
+A "saturating" signed integral type is developed. This type has +/- infinity and a nan (like IEEE floating point) but otherwise obeys signed integral arithmetic. This class is subsequently used as the rep in boost::chrono::__duration__ to demonstrate a duration class that does not silently ignore overflow.
- BOOST_AUTO(t1, system_clock::now() + seconds(3));
- BOOST_AUTO(t2, system_clock::now() + nanoseconds(3));
- BOOST_AUTO(t3, (min)(t1, t2));
+['See the source file [@../../example/satutating.cpp example/satutating.cpp]]
-['See the source file [@../../example/min_time_point.cpp example/min_time_point.cpp]]
+[endsect]
[endsect]
+[section Clocks]
[/==================]
[section Cycle count]
@@ -1549,11 +1766,11 @@
template <long long speed>
struct cycle_count
{
- typedef typename boost::ratio_multiply<boost::ratio<speed>, boost::mega>::type frequency; // Mhz
- typedef typename boost::ratio_divide<boost::ratio<1>, frequency>::type period;
+ typedef typename boost::ratio_multiply<boost::__ratio__<speed>, boost::mega>::type frequency; // Mhz
+ typedef typename boost::ratio_divide<boost::__ratio__<1>, frequency>::type period;
typedef long long rep;
- typedef boost::chrono::duration<rep, period> duration;
- typedef boost::chrono::time_point<cycle_count> time_point;
+ typedef boost::chrono::__duration__<rep, period> duration;
+ typedef boost::chrono::__time_point__<cycle_count> time_point;
static time_point now()
{
@@ -1571,7 +1788,7 @@
typedef duration::rep rep;
typedef duration::period period;
static const long long nanosec_per_sec = period::den;
- typedef boost::chrono::time_point<approx_cycle_count> time_point;
+ typedef boost::chrono::__time_point__<approx_cycle_count> time_point;
static time_point now()
{
@@ -1587,87 +1804,6 @@
[endsect]
[/==================]
-[section xtime conversions]
-
-Example round_up utility: converts d to To, rounding up for inexact conversions
-Being able to *easily* write this function is a major feature!
-
- #include <boost/chrono/chrono.hpp>
- #include <boost/type_traits.hpp>
-
- #include <iostream>
-
- using namespace boost::chrono;
-
- template <class To, class Rep, class Period>
- To
- round_up(duration<Rep, Period> d)
- {
- To result = duration_cast<To>(d);
- if (result < d)
- ++result;
- return result;
- }
-
-Demonstrate interaction with xtime-like facility:
-
-
- struct xtime
- {
- long sec;
- unsigned long usec;
- };
-
- template <class Rep, class Period>
- xtime
- to_xtime_truncate(duration<Rep, Period> d)
- {
- xtime xt;
- xt.sec = static_cast<long>(duration_cast<seconds>(d).count());
- xt.usec = static_cast<long>(duration_cast<microseconds>(d - seconds(xt.sec)).count());
- return xt;
- }
-
- template <class Rep, class Period>
- xtime
- to_xtime_round_up(duration<Rep, Period> d)
- {
- xtime xt;
- xt.sec = static_cast<long>(duration_cast<seconds>(d).count());
- xt.usec = static_cast<unsigned long>(round_up<microseconds>(d - seconds(xt.sec)).count());
- return xt;
- }
-
- microseconds
- from_xtime(xtime xt)
- {
- return seconds(xt.sec) + microseconds(xt.usec);
- }
-
- void print(xtime xt)
- {
- std::cout << '{' << xt.sec << ',' << xt.usec << "}\n";
- }
-
-Usage
-
- xtime xt = to_xtime_truncate(seconds(3) + milliseconds(251));
- print(xt);
- milliseconds ms = duration_cast<milliseconds>(from_xtime(xt));
- std::cout << ms.count() << " milliseconds\n";
- xt = to_xtime_round_up(ms);
- print(xt);
- xt = to_xtime_truncate(seconds(3) + nanoseconds(999));
- print(xt);
- xt = to_xtime_round_up(seconds(3) + nanoseconds(999));
- print(xt);
-
-
-['See the source file [@../../example/xtime.cpp here]]
-
-[endsect]
-
-[/==================]
[section xtime_clock]
This example demonstrates the use of a timeval-like struct to be used as the representation
@@ -1761,8 +1897,8 @@
public:
typedef xtime rep;
typedef boost::micro period;
- typedef boost::chrono::duration<rep, period> duration;
- typedef boost::chrono::time_point<xtime_clock> time_point;
+ typedef boost::chrono::__duration__<rep, period> duration;
+ typedef boost::chrono::__time_point__<xtime_clock> time_point;
static time_point now()
{
@@ -1798,235 +1934,113 @@
std::cout << "sizeof xtime_clock::rep = " << sizeof(xtime_clock::rep) << '\n';
xtime_clock::duration delay(milliseconds(5));
xtime_clock::time_point start = xtime_clock::now();
- while (xtime_clock::now() - start <= delay) {}
- xtime_clock::time_point stop = xtime_clock::now();
- xtime_clock::duration elapsed = stop - start;
- std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
-
-
-['See the source file [@../../example/timeval_demo.cpp example/timeval_demo.cpp]]
-
-[endsect]
-
-[/=========================]
-[section runtime_resolution]
-
-Handle duration with resolution not known until run time
-
- class duration
- {
- public:
- typedef long long rep;
- private:
- rep rep_;
-
- static const double ticks_per_nanosecond;
-
- public:
- typedef boost::chrono::duration<double, boost::nano> tonanosec;
-
- duration() {} // = default;
- explicit duration(const rep& r) : rep_(r) {}
-
- // conversions
- explicit duration(const tonanosec& d)
- : rep_(static_cast<rep>(d.count() * ticks_per_nanosecond)) {}
-
- // explicit
- operator tonanosec() const {return tonanosec(rep_/ticks_per_nanosecond);}
-
- // observer
-
- rep count() const {return rep_;}
-
- // arithmetic
-
- duration& operator+=(const duration& d) {rep_ += d.rep_; return *this;}
- duration& operator-=(const duration& d) {rep_ += d.rep_; return *this;}
- duration& operator*=(rep rhs) {rep_ *= rhs; return *this;}
- duration& operator/=(rep rhs) {rep_ /= rhs; return *this;}
-
- duration operator+() const {return *this;}
- duration operator-() const {return duration(-rep_);}
- duration& operator++() {++rep_; return *this;}
- duration operator++(int) {return duration(rep_++);}
- duration& operator--() {--rep_; return *this;}
- duration operator--(int) {return duration(rep_--);}
-
- friend duration operator+(duration x, duration y) {return x += y;}
- friend duration operator-(duration x, duration y) {return x -= y;}
- friend duration operator*(duration x, rep y) {return x *= y;}
- friend duration operator*(rep x, duration y) {return y *= x;}
- friend duration operator/(duration x, rep y) {return x /= y;}
-
- friend bool operator==(duration x, duration y) {return x.rep_ == y.rep_;}
- friend bool operator!=(duration x, duration y) {return !(x == y);}
- friend bool operator< (duration x, duration y) {return x.rep_ < y.rep_;}
- friend bool operator<=(duration x, duration y) {return !(y < x);}
- friend bool operator> (duration x, duration y) {return y < x;}
- friend bool operator>=(duration x, duration y) {return !(x < y);}
- };
-
-['See the source file [@../../example/runtime_resolution.cpp here]]
-
-[endsect]
-
-[/=======================================================]
-[section Simulated thread interface demonstration program]
-
-Free sleep functions
-
- namespace boost { namespace this_thread {
-
- template <class Rep, class Period>
- void sleep_for(const boost::chrono::duration<Rep, Period>& d) {
- boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
- if (t < d)
- ++t;
- if (t > boost::chrono::microseconds(0))
- std::cout << "sleep_for " << t.count() << " microseconds\n";
- }
-
- template <class Clock, class Duration>
- void sleep_until(const boost::chrono::time_point<Clock, Duration>& t) {
- using namespace boost::chrono;
- typedef time_point<Clock, Duration> Time;
- typedef system_clock::time_point SysTime;
- if (t > Clock::now()) {
- typedef typename boost::common_type<typename Time::duration,
- typename SysTime::duration>::type D;
- /* auto */ D d = t - Clock::now();
- microseconds us = duration_cast<microseconds>(d);
- if (us < d)
- ++us;
- SysTime st = system_clock::now() + us;
- std::cout << "sleep_until ";
- detail::print_time(st);
- std::cout << " which is " << (st - system_clock::now()).count() << " microseconds away\n";
- }
- }
-
- }}
-
-
-timed_mutex modified fuctions
-
- namespace boost {
- struct timed_mutex {
- // ...
-
- template <class Rep, class Period>
- bool try_lock_for(const boost::chrono::duration<Rep, Period>& d) {
- boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
- if (t <= boost::chrono::microseconds(0))
- return try_lock();
- std::cout << "try_lock_for " << t.count() << " microseconds\n";
- return true;
- }
-
- template <class Clock, class Duration>
- bool try_lock_until(const boost::chrono::time_point<Clock, Duration>& t)
- {
- using namespace boost::chrono;
- typedef time_point<Clock, Duration> Time;
- typedef system_clock::time_point SysTime;
- if (t <= Clock::now())
- return try_lock();
- typedef typename boost::common_type<typename Time::duration,
- typename Clock::duration>::type D;
- /* auto */ D d = t - Clock::now();
- microseconds us = duration_cast<microseconds>(d);
- SysTime st = system_clock::now() + us;
- std::cout << "try_lock_until ";
- detail::print_time(st);
- std::cout << " which is " << (st - system_clock::now()).count()
- << " microseconds away\n";
- return true;
- }
- };
- }
-
-condition_variable modified fuctions
-
- namespace boost {
- struct condition_variable
- {
- // ...
-
- template <class Rep, class Period>
- bool wait_for(mutex&, const boost::chrono::duration<Rep, Period>& d) {
- boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
- std::cout << "wait_for " << t.count() << " microseconds\n";
- return true;
- }
-
- template <class Clock, class Duration>
- bool wait_until(mutex&, const boost::chrono::time_point<Clock, Duration>& t) {
- using namespace boost::chrono;
- typedef time_point<Clock, Duration> Time;
- typedef system_clock::time_point SysTime;
- if (t <= Clock::now())
- return false;
- typedef typename boost::common_type<typename Time::duration,
- typename Clock::duration>::type D;
- /* auto */ D d = t - Clock::now();
- microseconds us = duration_cast<microseconds>(d);
- SysTime st = system_clock::now() + us;
- std::cout << "wait_until ";
- detail::print_time(st);
- std::cout << " which is " << (st - system_clock::now()).count()
- << " microseconds away\n";
- return true;
- }
- };
- }
+ while (xtime_clock::now() - start <= delay) {}
+ xtime_clock::time_point stop = xtime_clock::now();
+ xtime_clock::duration elapsed = stop - start;
+ std::cout << "paused " << nanoseconds(elapsed).count() << " nanoseconds\n";
-Usage
- boost::mutex m;
- boost::timed_mutex mut;
- boost::condition_variable cv;
+['See the source file [@../../example/timeval_demo.cpp example/timeval_demo.cpp]]
+
+[endsect]
+[endsect]
+
+[section Conversions]
+
+[/==================]
+[section xtime conversions]
+
+Example round_up utility: converts d to To, rounding up for inexact conversions
+Being able to *easily* write this function is a major feature!
+
+ #include <boost/chrono/chrono.hpp>
+ #include <boost/type_traits.hpp>
+
+ #include <iostream>
- using namespace boost;
using namespace boost::chrono;
- this_thread::sleep_for(seconds(3));
- this_thread::sleep_for(nanoseconds(300));
- system_clock::time_point time_limit = system_clock::now() + seconds(4) + milliseconds(500);
- this_thread::sleep_until(time_limit);
+ template <class To, class Rep, class Period>
+ To
+ round_up(duration<Rep, Period> d)
+ {
+ To result = duration_cast<To>(d);
+ if (result < d)
+ ++result;
+ return result;
+ }
- mut.try_lock_for(milliseconds(30));
- mut.try_lock_until(time_limit);
+Demonstrate interaction with xtime-like facility:
- cv.wait_for(m, minutes(1)); // real code would put this in a loop
- cv.wait_until(m, time_limit); // real code would put this in a loop
- // For those who prefer floating point
- this_thread::sleep_for(duration<double>(0.25));
- this_thread::sleep_until(system_clock::now() + duration<double>(1.5));
+ struct xtime
+ {
+ long sec;
+ unsigned long usec;
+ };
+ template <class Rep, class Period>
+ xtime
+ to_xtime_truncate(__duration__<Rep, Period> d)
+ {
+ xtime xt;
+ xt.sec = static_cast<long>(duration_cast<seconds>(d).count());
+ xt.usec = static_cast<long>(duration_cast<microseconds>(d - seconds(xt.sec)).count());
+ return xt;
+ }
-['See the source file [@../../example/simulated_thread_interface_demo.cpp example/simulated_thread_interface_demo.cpp]]
+ template <class Rep, class Period>
+ xtime
+ to_xtime_round_up(__duration__<Rep, Period> d)
+ {
+ xtime xt;
+ xt.sec = static_cast<long>(duration_cast<seconds>(d).count());
+ xt.usec = static_cast<unsigned long>(round_up<microseconds>(d - seconds(xt.sec)).count());
+ return xt;
+ }
+ microseconds
+ from_xtime(xtime xt)
+ {
+ return seconds(xt.sec) + microseconds(xt.usec);
+ }
-[endsect]
+ void print(xtime xt)
+ {
+ std::cout << '{' << xt.sec << ',' << xt.usec << "}\n";
+ }
-[/================]
-[section Saturating]
+Usage
-A "saturating" signed integral type is developed. This type has +/- infinity and a nan (like IEEE floating point) but otherwise obeys signed integral arithmetic. This class is subsequently used as the rep in boost::chrono::duration to demonstrate a duration class that does not silently ignore overflow.
+ xtime xt = to_xtime_truncate(seconds(3) + milliseconds(251));
+ print(xt);
+ milliseconds ms = duration_cast<milliseconds>(from_xtime(xt));
+ std::cout << ms.count() << " milliseconds\n";
+ xt = to_xtime_round_up(ms);
+ print(xt);
+ xt = to_xtime_truncate(seconds(3) + nanoseconds(999));
+ print(xt);
+ xt = to_xtime_round_up(seconds(3) + nanoseconds(999));
+ print(xt);
-['See the source file [@../../example/satutating.cpp example/satutating.cpp]]
+['See the source file [@../../example/xtime.cpp here]]
[endsect]
+[endsect]
+
+
+[/
[/======================================================]
[section Howard Hinnant's original demonstration program]
['See the source file [@../../example/time2_demo.cpp example/time2_demo.cpp]]
[endsect]
+]
+
+[section Reporting]
[/===============================================================]
[section A tiny program that times how long until a key is struck]
@@ -2217,6 +2231,149 @@
['See the source file [@../../example/timex.cpp example/timex.cpp]]
[endsect]
+[endsect]
+
+[/=======================================================]
+[section Simulated thread interface demonstration program]
+
+The C++0x standard library's multi-threading library requires the ability to deal with the representation of time in a manner consistent with modern C++ practices. Next follows a simaulation of this interface.
+
+Free sleep functions
+
+ namespace boost { namespace this_thread {
+
+ template <class Rep, class Period>
+ void sleep_for(const boost::chrono::__duration__<Rep, Period>& d) {
+ boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
+ if (t < d)
+ ++t;
+ if (t > boost::chrono::microseconds(0))
+ std::cout << "sleep_for " << t.count() << " microseconds\n";
+ }
+
+ template <class Clock, class Duration>
+ void sleep_until(const boost::chrono::__time_point__<Clock, Duration>& t) {
+ using namespace boost::chrono;
+ typedef __time_point__<Clock, Duration> Time;
+ typedef system_clock::time_point SysTime;
+ if (t > Clock::now()) {
+ typedef typename boost::__common_type__<typename Time::duration,
+ typename SysTime::duration>::type D;
+ /* auto */ D d = t - Clock::now();
+ microseconds us = duration_cast<microseconds>(d);
+ if (us < d)
+ ++us;
+ SysTime st = system_clock::now() + us;
+ std::cout << "sleep_until ";
+ detail::print_time(st);
+ std::cout << " which is " << (st - system_clock::now()).count() << " microseconds away\n";
+ }
+ }
+
+ }}
+
+
+timed_mutex modified fuctions
+
+ namespace boost {
+ struct timed_mutex {
+ // ...
+
+ template <class Rep, class Period>
+ bool try_lock_for(const boost::chrono::__duration__<Rep, Period>& d) {
+ boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
+ if (t <= boost::chrono::microseconds(0))
+ return try_lock();
+ std::cout << "try_lock_for " << t.count() << " microseconds\n";
+ return true;
+ }
+
+ template <class Clock, class Duration>
+ bool try_lock_until(const boost::chrono::__time_point__<Clock, Duration>& t)
+ {
+ using namespace boost::chrono;
+ typedef __time_point__<Clock, Duration> Time;
+ typedef system_clock::time_point SysTime;
+ if (t <= Clock::now())
+ return try_lock();
+ typedef typename boost::__common_type__<typename Time::duration,
+ typename Clock::duration>::type D;
+ /* auto */ D d = t - Clock::now();
+ microseconds us = duration_cast<microseconds>(d);
+ SysTime st = system_clock::now() + us;
+ std::cout << "try_lock_until ";
+ detail::print_time(st);
+ std::cout << " which is " << (st - system_clock::now()).count()
+ << " microseconds away\n";
+ return true;
+ }
+ };
+ }
+
+condition_variable modified fuctions
+
+ namespace boost {
+ struct condition_variable
+ {
+ // ...
+
+ template <class Rep, class Period>
+ bool wait_for(mutex&, const boost::chrono::__duration__<Rep, Period>& d) {
+ boost::chrono::microseconds t = boost::chrono::duration_cast<boost::chrono::microseconds>(d);
+ std::cout << "wait_for " << t.count() << " microseconds\n";
+ return true;
+ }
+
+ template <class Clock, class Duration>
+ bool wait_until(mutex&, const boost::chrono::__time_point__<Clock, Duration>& t) {
+ using namespace boost::chrono;
+ typedef __time_point__<Clock, Duration> Time;
+ typedef system_clock::time_point SysTime;
+ if (t <= Clock::now())
+ return false;
+ typedef typename boost::__common_type__<typename Time::duration,
+ typename Clock::duration>::type D;
+ /* auto */ D d = t - Clock::now();
+ microseconds us = duration_cast<microseconds>(d);
+ SysTime st = system_clock::now() + us;
+ std::cout << "wait_until ";
+ detail::print_time(st);
+ std::cout << " which is " << (st - system_clock::now()).count()
+ << " microseconds away\n";
+ return true;
+ }
+ };
+ }
+
+Usage
+
+ boost::mutex m;
+ boost::timed_mutex mut;
+ boost::condition_variable cv;
+
+ using namespace boost;
+ using namespace boost::chrono;
+
+ this_thread::sleep_for(seconds(3));
+ this_thread::sleep_for(nanoseconds(300));
+ system_clock::time_point time_limit = system_clock::now() + seconds(4) + milliseconds(500);
+ this_thread::sleep_until(time_limit);
+
+ mut.try_lock_for(milliseconds(30));
+ mut.try_lock_until(time_limit);
+
+ cv.wait_for(m, minutes(1)); // real code would put this in a loop
+ cv.wait_until(m, time_limit); // real code would put this in a loop
+
+ // For those who prefer floating point
+ this_thread::sleep_for(__duration__<double>(0.25));
+ this_thread::sleep_until(system_clock::now() + __duration__<double>(1.5));
+
+
+['See the source file [@../../example/simulated_thread_interface_demo.cpp example/simulated_thread_interface_demo.cpp]]
+
+
+[endsect]
[endsect]
@@ -2269,20 +2426,19 @@
[section:common_type_hpp Header `<boost/type_traits/common_type.hpp>`]
[/===================================================================]
- #define BOOST_COMMON_TYPE_ARITY
- #define BOOST_COMMON_TYPE_USES_STATIC_ASSERT
- #define BOOST_COMMON_TYPE_USES_MPL_ASSERT
- #define BOOST_COMMON_TYPE_USES_ARRAY_ASSERT
+ // configuration macros
+ #define __common_type__BOOST_COMMON_TYPE_USES_STATIC_ASSERT
+ #define __common_type__BOOST_COMMON_TYPE_USES_MPL_ASSERT
+ #define __common_type__BOOST_COMMON_TYPE_USES_ARRAY_ASSERT
- #define BOOST_COMMON_TYPE_MUST_BE_A_COMPLETE_TYPE
+ // preprocessor info
+ #define __common_type__BOOST_COMMON_TYPE_ARITY
namespace boost {
- template <class ...T> struct common_type;
+ template <class ...T> struct __common_type__;
}
-[section:macros Configuration macros]
-
-When BOOST_NO_VARIADIC_TEMPLATES is defined BOOST_COMMON_TYPE_ARITY gives the maximum number of template parameters for __common_type__.
+[section:conf Configuration macros]
When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static assertions are reported. Define
@@ -2301,15 +2457,21 @@
[endsect]
-[section:common_type Class Template 'common_type<>']
+[section:pp Preprocessor info]
+
+When BOOST_NO_VARIADIC_TEMPLATES is defined BOOST_COMMON_TYPE_ARITY gives the maximum number of template parameters for __common_type__.
+
+[endsect]
+
+[section:common_type Class Template `common_type<>`]
__common_type__ is a facility which is useful in specifying the type of the result of functions and operators which take a variety of types (e.g. "mixed mode" complex arithmetic).
-The nested typedef `common_type::type` could be defined as follows:
+The nested typedef __common_type__::type` could be defined as follows:
template <class T, class U = void, class V = void>
struct common_type {
- typedef typename common_type<typename common_type<T, U>::type, V>::type type;
+ typedef typename __common_type__<typename __common_type__<T, U>::type, V>::type type;
};
template <class T>
@@ -2343,58 +2505,50 @@
__ratio__ is a facility which is useful in specifying compile time rational constants. Compile time rational arithmetic is supported with protection against overflow and divide by zero. Such a facility is very handy when needing to efficiently represent 1/3 of a nanosecond, or specifying an inch in terms of meters (for example 254/10000 meters - which __ratio__ will reduce to 127/5000 meters).
- #define BOOST_RATIO_USES_STATIC_ASSERT
- #define BOOST_RATIO_USES_MPL_ASSERT
- #define BOOST_RATIO_USES_ARRAY_ASSERT
-
- #define BOOST_RATIO_OVERFLOW_IN_ADD
- #define BOOST_RATIO_OVERFLOW_IN_ADD
- #define BOOST_RATIO_OVERFLOW_IN_SUB
- #define BOOST_RATIO_OVERFLOW_IN_MUL
- #define BOOST_RATIO_OVERFLOW_IN_DIV
- #define BOOST_RATIO_RATIO_NUMERATOR_IS_OUT_OF_RANGE
- #define BOOST_RATIO_RATIO_DIVIDE_BY_0
- #define BOOST_RATIO_RATIO_DENOMINATOR_IS_OUT_OF_RANGE
+ // configuration macros
+ #define __BOOST_RATIO_USES_STATIC_ASSERT
+ #define __BOOST_RATIO_USES_MPL_ASSERT
+ #define __BOOST_RATIO_USES_ARRAY_ASSERT
namespace boost {
- template <boost::intmax_t N, boost::intmax_t D = 1> class ratio;
+ template <boost::intmax_t N, boost::intmax_t D = 1> class __ratio__;
// ratio arithmetic
- template <class R1, class R2> struct ratio_add;
- template <class R1, class R2> struct ratio_subtract;
- template <class R1, class R2> struct ratio_multiply;
- template <class R1, class R2> struct ratio_divide;
+ template <class R1, class R2> struct __ratio_add;
+ template <class R1, class R2> struct __ratio_subtract;
+ template <class R1, class R2> struct __ratio_multiply;
+ template <class R1, class R2> struct __ratio_divide;
// ratio comparison
- template <class R1, class R2> struct ratio_equal;
- template <class R1, class R2> struct ratio_not_equal;
- template <class R1, class R2> struct ratio_less;
- template <class R1, class R2> struct ratio_less_equal;
- template <class R1, class R2> struct ratio_greater;
- template <class R1, class R2> struct ratio_greater_equal;
+ template <class R1, class R2> struct __ratio_equal;
+ template <class R1, class R2> struct __ratio_not_equal;
+ template <class R1, class R2> struct __ratio_less;
+ template <class R1, class R2> struct __ratio_less_equal;
+ template <class R1, class R2> struct __ratio_greater;
+ template <class R1, class R2> struct __ratio_greater_equal;
// convenience SI typedefs
- typedef ratio<1LL, 1000000000000000000LL> atto;
- typedef ratio<1LL, 1000000000000000LL> femto;
- typedef ratio<1LL, 1000000000000LL> pico;
- typedef ratio<1LL, 1000000000LL> nano;
- typedef ratio<1LL, 1000000LL> micro;
- typedef ratio<1LL, 1000LL> milli;
- typedef ratio<1LL, 100LL> centi;
- typedef ratio<1LL, 10LL> deci;
- typedef ratio< 10LL, 1LL> deca;
- typedef ratio< 100LL, 1LL> hecto;
- typedef ratio< 1000LL, 1LL> kilo;
- typedef ratio< 1000000LL, 1LL> mega;
- typedef ratio< 1000000000LL, 1LL> giga;
- typedef ratio< 1000000000000LL, 1LL> tera;
- typedef ratio< 1000000000000000LL, 1LL> peta;
- typedef ratio<1000000000000000000LL, 1LL> exa;
+ typedef __ratio__<1LL, 1000000000000000000LL> __atto;
+ typedef __ratio__<1LL, 1000000000000000LL> __femto;
+ typedef __ratio__<1LL, 1000000000000LL> __pico;
+ typedef __ratio__<1LL, 1000000000LL> __nano;
+ typedef __ratio__<1LL, 1000000LL> __micro;
+ typedef __ratio__<1LL, 1000LL> __milli;
+ typedef __ratio__<1LL, 100LL> __centi;
+ typedef __ratio__<1LL, 10LL> __deci;
+ typedef __ratio__< 10LL, 1LL> __deca;
+ typedef __ratio__< 100LL, 1LL> __hecto;
+ typedef __ratio__< 1000LL, 1LL> __kilo;
+ typedef __ratio__< 1000000LL, 1LL> __mega;
+ typedef __ratio__< 1000000000LL, 1LL> __giga;
+ typedef __ratio__< 1000000000000LL, 1LL> __tera;
+ typedef __ratio__< 1000000000000000LL, 1LL> __peta;
+ typedef __ratio__<1000000000000000000LL, 1LL> __exa;
}
-[section:macros Configuration macros]
+[section:conf Configuration macros]
When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static assertions are reported. Define
@@ -2406,7 +2560,6 @@
When BOOST_RATIO_USES_MPL_ASSERT is not defined the following symbols are defined as
#define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add"
- #define BOOST_RATIO_OVERFLOW_IN_ADD "overflow in ratio add"
#define BOOST_RATIO_OVERFLOW_IN_SUB "overflow in ratio sub"
#define BOOST_RATIO_OVERFLOW_IN_MUL "overflow in ratio mul"
#define BOOST_RATIO_OVERFLOW_IN_DIV "overflow in ratio div"
@@ -2425,26 +2578,15 @@
public:
static const boost::intmax_t num;
static const boost::intmax_t den;
- typedef ratio<num, den> type;
+ typedef __ratio__<num, den> type;
- ratio() {}
+ ratio() = default;
template <intmax_t _N2, intmax_t _D2>
- ratio(const ratio<_N2, _D2>&,
- typename enable_if_c
- <
- ratio<_N2, _D2>::num == num &&
- ratio<_N2, _D2>::den == den
- >::type* = 0) {}
+ ratio(const __ratio__<_N2, _D2>&);
template <intmax_t _N2, intmax_t _D2>
- typename enable_if_c
- <
- ratio<_N2, _D2>::num == num &&
- ratio<_N2, _D2>::den == den,
- ratio&
- >::type
- operator=(const ratio<_N2, _D2>&) {return *this;}
+ __ratio__& operator=(const __ratio__<_N2, _D2>&) {return *this;}
};
A diagnostic will be emitted if __ratio__ is instantiated with `D == 0`, or if the absolute value of `N` or `D` can not be represented. [*Note:] These rules ensure that infinite ratios are avoided and that for any negative input, there exists a representable value of its absolute value which is positive. In a two's complement representation, this excludes the most negative value.
@@ -2455,21 +2597,21 @@
* `den` has the value `abs(D)/gcd`.
-The nested typedef `type` denotes the normalized form of this ratio type. It should be used when the template parameters doesn't give a normalized form.
+The nested typedef `type` denotes the normalized form of this __ratio__ type. It should be used when the template parameters doesn't give a normalized form.
-Two __ratio__ classes `ratio<N1,D1>` and `ratio<N2,D2>` have the same normalized form if `ratio<N1,D1>::type` is the same type as `ratio<N2,D2>::type`
+Two __ratio__ classes `__ratio__<N1,D1>` and `__ratio__<N2,D2>` have the same normalized form if `__ratio__<N1,D1>::type` is the same type as `__ratio__<N2,D2>::type`
[section Construction and assignment]
template <intmax_t N2, intmax_t D2>
- ratio(const ratio<N2, D2>& r);
+ ratio(const __ratio__<N2, D2>& r);
[*Effects:] Constructs a __ratio__ object.
[*Remarks:] This constructor will not participate in overload resolution unless `r` has the same normalized form as `*this`.
template <intmax_t N2, intmax_t D2>
- ratio& operator=(const ratio<N2, D2>& r);
+ __ratio__& operator=(const __ratio__<N2, D2>& r);
[*Effects:] Assigns a __ratio__ object.
@@ -2483,7 +2625,7 @@
[endsect]
-[section:ratio_arithmetic __ratio__ arithmetic]
+[section:ratio_arithmetic `ratio` arithmetic]
For each of the class templates in this clause, each template parameter refers to a `ratio`. If the implementation is unable to form the indicated __ratio__ due to overflow, a diagnostic will be issued.
@@ -2491,29 +2633,29 @@
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `ratio<R1::num * R2::den + R2::num * R1::den, R1::den * R2::den>::type`.
+The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::den + R2::num * R1::den, R1::den * R2::den>::type`.
template <class R1, class R2> struct ratio_subtract {
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `ratio<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type`.
+The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::den - R2::num * R1::den, R1::den * R2::den>::type`.
template <class R1, class R2> struct ratio_multiply {
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `ratio<R1::num * R2::num, R1::den * R2::den>::type`.
+The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::num, R1::den * R2::den>::type`.
template <class R1, class R2> struct ratio_divide {
typedef [/see below] type;
};
-The nested typedef `type` is a synonym for `ratio<R1::num * R2::den, R2::num * R1::den>::type`.
+The nested typedef `type` is a synonym for `__ratio__<R1::num * R2::den, R2::num * R1::den>::type`.
[endsect]
-[section:ratio_comparison __ratio__ comparison]
+[section:ratio_comparison `ratio` comparison]
template <class R1, class R2> struct ratio_equal
: public boost::integral_constant<bool, [/see below] > {};
@@ -2541,33 +2683,33 @@
[endsect]
-[section:ration_SI_typedefs SI typedefs]
+[section:ratio_si_typedefs SI typedefs]
// convenience SI typedefs
- typedef ratio<1LL, 1000000000000000000LL> atto;
- typedef ratio<1LL, 1000000000000000LL> femto;
- typedef ratio<1LL, 1000000000000LL> pico;
- typedef ratio<1LL, 1000000000LL> nano;
- typedef ratio<1LL, 1000000LL> micro;
- typedef ratio<1LL, 1000LL> milli;
- typedef ratio<1LL, 100LL> centi;
- typedef ratio<1LL, 10LL> deci;
- typedef ratio< 10LL, 1LL> deca;
- typedef ratio< 100LL, 1LL> hecto;
- typedef ratio< 1000LL, 1LL> kilo;
- typedef ratio< 1000000LL, 1LL> mega;
- typedef ratio< 1000000000LL, 1LL> giga;
- typedef ratio< 1000000000000LL, 1LL> tera;
- typedef ratio< 1000000000000000LL, 1LL> peta;
- typedef ratio<1000000000000000000LL, 1LL> exa;
+ typedef __ratio__<1LL, 1000000000000000000LL> atto;
+ typedef __ratio__<1LL, 1000000000000000LL> femto;
+ typedef __ratio__<1LL, 1000000000000LL> pico;
+ typedef __ratio__<1LL, 1000000000LL> nano;
+ typedef __ratio__<1LL, 1000000LL> micro;
+ typedef __ratio__<1LL, 1000LL> milli;
+ typedef __ratio__<1LL, 100LL> centi;
+ typedef __ratio__<1LL, 10LL> deci;
+ typedef __ratio__< 10LL, 1LL> deca;
+ typedef __ratio__< 100LL, 1LL> hecto;
+ typedef __ratio__< 1000LL, 1LL> kilo;
+ typedef __ratio__< 1000000LL, 1LL> mega;
+ typedef __ratio__< 1000000000LL, 1LL> giga;
+ typedef __ratio__< 1000000000000LL, 1LL> tera;
+ typedef __ratio__< 1000000000000000LL, 1LL> peta;
+ typedef __ratio__<1000000000000000000LL, 1LL> exa;
Four of the typedefs in the recomendation which can be conditionally supported are not supported: yocto, zepto, zetta and yotta.
- typedef ratio<1, 1000000000000000000000000> yocto; // conditionally supported
- typedef ratio<1, 1000000000000000000000> zepto; // conditionally supported
- typedef ratio< 1000000000000000000000, 1> zetta; // conditionally supported
- typedef ratio<1000000000000000000000000, 1> yotta; // conditionally supported
+ typedef __ratio__<1, 1000000000000000000000000> yocto; // conditionally supported
+ typedef __ratio__<1, 1000000000000000000000> zepto; // conditionally supported
+ typedef __ratio__< 1000000000000000000000, 1> zetta; // conditionally supported
+ typedef __ratio__<1000000000000000000000000, 1> yotta; // conditionally supported
[endsect]
@@ -2589,147 +2731,145 @@
[section:chrono_chrono_hpp Header `<boost/chrono/chrono.hpp>`]
[/=============================================]
- #define BOOST_CHRONO_HAS_CLOCK_MONOTONIC
-
- #define BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION \
- "A duration representation can not be a duration"
- #define BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO \
- "Second template parameter of duration must be a std::ratio"
- #define BOOST_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE \
- "duration period must be positive"
- #define BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_TIME_POINT_MUST_BE_A_BOOST_CHRONO_DURATION \
+ // configuration macros
+ #define __BOOST_CHRONO_USES_STATIC_ASSERT
+ #define __BOOST_CHRONO_USES_MPL_ASSERT
+ #define __BOOST_CHRONO_USES_ARRAY_ASSERT
+
+ // preprocessor info
+ #define __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
namespace boost {
namespace chrono {
- template <class Rep, class Period = ratio<1> > class duration;
- template <class Clock, class Duration = typename Clock::duration> class time_point;
+ template <class Rep, class Period = __ratio__<1> > class __duration__;
+ template <class Clock, class Duration = typename Clock::duration> class __time_point__;
}
template <class Rep1, class Period1, class Rep2, class Period2>
- struct common_type<chrono::duration<Rep1, Period1>,
- chrono::duration<Rep2, Period2> >;
+ struct __common_type_spe__<__duration__<Rep1, Period1>,
+ __duration__<Rep2, Period2> >;
template <class Clock, class Duration1, class Duration2>
- struct common_type<chrono::time_point<Clock, Duration1>,
- chrono::time_point<Clock, Duration2> >;
+ struct __common_type_spe__<__time_point__<Clock, Duration1>,
+ __time_point__<Clock, Duration2> >;
namespace chrono {
// customization traits
- template <class Rep> struct treat_as_floating_point;
- template <class Rep> struct duration_values;
+ template <class Rep> struct __treat_as_floating_point__;
+ template <class Rep> struct __duration_values__;
// duration arithmetic
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
- operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<__duration__<Rep1, Period1>, __duration__<Rep2, Period2> >::type
+ operator+(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
- operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<__duration__<Rep1, Period1>, __duration__<Rep2, Period2> >::type
+ operator-(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator*(const duration<Rep1, Period>& d, const Rep2& s);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator*(const __duration__<Rep1, Period>& d, const Rep2& s);
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator*(const Rep1& s, const duration<Rep2, Period>& d);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator*(const Rep1& s, const __duration__<Rep2, Period>& d);
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator/(const duration<Rep1, Period>& d, const Rep2& s);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator/(const __duration__<Rep1, Period>& d, const Rep2& s);
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<Rep1, Rep2>::type
- operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<Rep1, Rep2>::type
+ operator/(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Rep2, class Period>
- double operator/(const Rep1& s, const duration<Rep2, Period>& d);
+ double operator/(const Rep1& s, const __duration__<Rep2, Period>& d);
// duration comparisons
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator==(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator!=(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator< (const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator<=(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator> (const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator>=(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
// duration_cast
template <class ToDuration, class Rep, class Period>
- ToDuration duration_cast(const duration<Rep, Period>& d);
+ ToDuration __duration_cast__(const __duration__<Rep, Period>& d);
// convenience typedefs
- typedef duration<boost::int_least64_t, nano> nanoseconds; // at least 64 bits needed
- typedef duration<boost::int_least64_t, micro> microseconds; // at least 55 bits needed
- typedef duration<boost::int_least64_t, milli> milliseconds; // at least 45 bits needed
- typedef duration<boost::int_least64_t> seconds; // at least 35 bits needed
- typedef duration<boost::int_least32_t, ratio< 60> > minutes; // at least 29 bits needed
- typedef duration<boost::int_least32_t, ratio<3600> > hours; // at least 23 bits needed
+ typedef __duration__<boost::int_least64_t, nano> __nanoseconds__; // at least 64 bits needed
+ typedef __duration__<boost::int_least64_t, micro> __microseconds__; // at least 55 bits needed
+ typedef __duration__<boost::int_least64_t, milli> __milliseconds__; // at least 45 bits needed
+ typedef __duration__<boost::int_least64_t> __seconds__; // at least 35 bits needed
+ typedef __duration__<boost::int_least32_t, __ratio__< 60> > __minutes__; // at least 29 bits needed
+ typedef __duration__<boost::int_least32_t, __ratio__<3600> > __hours__; // at least 23 bits needed
// time_point arithmetic
template <class Clock, class Duration1, class Rep2, class Period2>
- time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2> >::type>
- operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
+ __time_point__<Clock, typename __common_type__<Duration1, __duration__<Rep2, Period2> >::type>
+ operator+(const __time_point__<Clock, Duration1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Rep1, class Period1, class Clock, class Duration2>
- time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
- operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
+ __time_point__<Clock, typename __common_type__<__duration__<Rep1, Period1>, Duration2>::type>
+ operator+(const __duration__<Rep1, Period1>& lhs, const __time_point__<Clock, Duration2>& rhs);
template <class Clock, class Duration1, class Rep2, class Period2>
- time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2> >::type>
- operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
+ __time_point__<Clock, typename __common_type__<Duration1, __duration__<Rep2, Period2> >::type>
+ operator-(const __time_point__<Clock, Duration1>& lhs, const __duration__<Rep2, Period2>& rhs);
template <class Clock, class Duration1, class Duration2>
- typename common_type<Duration1, Duration2>::type
- operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ typename __common_type__<Duration1, Duration2>::type
+ operator-(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
// time_point comparisons
template <class Clock, class Duration1, class Duration2>
- bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ bool operator==(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ bool operator!=(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ bool operator< (const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ bool operator<=(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ bool operator> (const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
template <class Clock, class Duration1, class Duration2>
- bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock,
+ bool operator>=(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock,
Duration2>& rhs);
// time_point_cast
template <class ToDuration, class Clock, class Duration>
- time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
+ __time_point__<Clock, ToDuration> __time_point_cast__(const __time_point__<Clock, Duration>& t);
// Clocks
- class system_clock;
- class monotonic_clock;
- class high_resolution_clock;
+ class __system_clock__;
+ class __monotonic_clock__;
+ class __high_resolution_clock__;
}
}
-[section:macros Configuration macros]
+[section:conf Configuration macros]
When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static assertions are reported. Define
@@ -2804,7 +2944,7 @@
static BOOST_CHRONO_CONSTEXPR Rep min();
};
-The __duration__ template uses the __duration_values__ trait to construct special values of the __duration_s__ representation (`Rep`). This is done because the representation might be a class type with behavior which requires some other implementation to return these special values. In that case, the author of that class type should specialize `duration_values` to return the indicated values.
+The __duration__ template uses the __duration_values__ trait to construct special values of the __duration_s__ representation (`Rep`). This is done because the representation might be a class type with behavior which requires some other implementation to return these special values. In that case, the author of that class type should specialize __duration_values__ to return the indicated values.
[section:zero Static member Function `zero()`]
@@ -2836,12 +2976,14 @@
[endsect]
-[section `common_type` specializations]
+[endsect]
+
+[section:common_type_spe `common_type` specializations]
template <class Rep1, class Period1, class Rep2, class Period2>
- struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2> >
+ struct __common_type__<chrono::__duration__<Rep1, Period1>, chrono::__duration__<Rep2, Period2> >
{
- typedef chrono::duration<typename common_type<Rep1, Rep2>::type, see below> type;
+ typedef chrono::__duration__<typename __common_type__<Rep1, Rep2>::type, see below> type;
};
The period of the __duration__ indicated by this specialization of __common_type__ is the greatest common divisor of `Period1` and `Period2`. This can be computed by forming a __ratio__ of the greatest common divisor of `Period1::num` and `Period2::num`, and the least common multiple of `Period1::den` and `Period2::den`.
@@ -2849,9 +2991,9 @@
[*Note:] The typedef type is the __duration__ with the largest tick period possible where both __duration__ arguments will convert to it without requiring a division operation. The representation of this type is intended to be able to hold any value resulting from this conversion, with the possible exception of round-off error when floating point __duration_s__ are involved (but not truncation error).
template <class Clock, class Duration1, class Duration2>
- struct common_type<chrono::time_point<Clock, Duration1>, chrono::time_point<Clock, Duration2> >
+ struct __common_type__<chrono::__time_point__<Clock, Duration1>, chrono::__time_point__<Clock, Duration2> >
{
- typedef chrono::time_point<Clock, typename common_type<Duration1, Duration2>::type> type;
+ typedef chrono::__time_point__<Clock, typename __common_type__<Duration1, Duration2>::type> type;
};
The __common_type__ of two __time_point_s__ is a __time_point__ with the same `clock` (both have the same `clock`), and the __common_type__ of the two __duration_s__.
@@ -2859,8 +3001,6 @@
[endsect]
-[endsect]
-
[section:duration Class template `duration<>`]
A __duration__ measures time between two points in time (__time_point__). A __duration__ has a representation which holds a count of ticks, and a tick period. The tick period is the amount of time which occurs from one tick to another in units of a second. It is expressed as a rational constant using `ratio`.
@@ -2877,23 +3017,10 @@
public:
BOOST_CHRONO_CONSTEXPR duration() {} // = default;
template <class Rep2>
- BOOST_CHRONO_CONSTEXPR explicit duration(const Rep2& r,
- typename boost::enable_if_c
- <
- boost::is_convertible<Rep2, rep>::value
- && (treat_as_floating_point<rep>::value
- || (!treat_as_floating_point<rep>::value
- && !treat_as_floating_point<Rep2>::value))
- >::type* = 0);
+ BOOST_CHRONO_CONSTEXPR explicit duration(const Rep2& r);
template <class Rep2, class Period2>
- BOOST_CHRONO_CONSTEXPR duration(const duration<Rep2, Period2>& d,
- typename boost::enable_if_c
- <
- treat_as_floating_point<rep>::value
- || (ratio_divide<Period2, period>::type::den == 1
- && !treat_as_floating_point<Rep2>::value)
- >::type* = 0);
+ BOOST_CHRONO_CONSTEXPR duration(const duration<Rep2, Period2>& d);
//~duration() = default;
//duration(const duration&) = default;
@@ -2931,11 +3058,11 @@
Examples:
-* `duration<long, ratio<60> >` holds a count of minutes using a long.
+* `__duration__<long, __ratio__<60> >` holds a count of minutes using a long.
-* `duration<long long, milli>` holds a count of milliseconds using a long long.
+* `__duration__<long long, milli>` holds a count of milliseconds using a long long.
-* `duration<double, ratio<1, 30> >` holds a count using a double with a tick period of 1/30 second (a tick frequency of 30 Hz).
+* `__duration__<double, __ratio__<1, 30> >` holds a count using a double with a tick period of 1/30 second (a tick frequency of 30 Hz).
The following members of __duration__ do not throw an exception unless the indicated operations on the representations throw an exception.
@@ -2953,8 +3080,8 @@
[*Example:]
- duration<int, milli> d(3.5); // do not compile
- duration<int, milli> d(3); // ok
+ __duration__<int, milli> d(3.5); // do not compile
+ __duration__<int, milli> d(3); // ok
[*Effects:] Constructs an object of type __duration__.
@@ -2964,17 +3091,17 @@
[section:duration_c_2 Constructor `duration(const duration&)`]
template <class Rep2, class Period2>
- BOOST_CHRONO_CONSTEXPR duration(const duration<Rep2, Period2>& d);
+ BOOST_CHRONO_CONSTEXPR __duration__(const __duration__<Rep2, Period2>& d);
[*Remarks:] `treat_as_floating_point<rep>::value`, or `ratio_divide<Period2, period>::type::den == 1`, else this constructor will not participate in overload resolution. [*note] This requirement prevents implicit truncation error when converting between integral-based __duration_s__. Such a construction could easily lead to confusion about the value of the __duration__.
[*Example:]
- duration<int, milli> ms(3);
- duration<int, micro> us = ms; // ok
- duration<int, milli> ms2 = us; // do not compile
+ __duration__<int, milli> ms(3);
+ __duration__<int, micro> us = ms; // ok
+ __duration__<int, milli> ms2 = us; // do not compile
-[*Effects:] Constructs an object of type __duration__, constructing `rep_` from `duration_cast<duration>(d).count()`.
+[*Effects:] Constructs an object of type __duration__, constructing `rep_` from `duration_cast<__duration__>(d).count()`.
[endsect]
[section:count Member function `count() const`]
@@ -2986,21 +3113,21 @@
[endsect]
[section:duration_operator_p Member function `operator+() const`]
- BOOST_CHRONO_CONSTEXPR duration operator+() const;
+ BOOST_CHRONO_CONSTEXPR __duration__ operator+() const;
[*Returns:] `*this`.
[endsect]
[section:duration_operator_m Member function `operator+() const`]
- BOOST_CHRONO_CONSTEXPR duration operator-() const;
+ BOOST_CHRONO_CONSTEXPR __duration__ operator-() const;
-[*Returns:] `duration(-rep_)`.
+[*Returns:] `__duration__(-rep_)`.
[endsect]
[section:duration_operator_pp Member function `operator++()`]
- duration& operator++();
+ __duration__& operator++();
[*Effects:] `++rep_`.
@@ -3009,14 +3136,14 @@
[endsect]
[section:duration_operator_pp2 Member function `operator++(int)`]
- duration operator++(int);
+ __duration__ operator++(int);
-[*Returns:] `duration(rep_++)v.
+[*Returns:] `__duration__(rep_++)v.
[endsect]
[section:duration_operator_mm Member function `operator++()`]
- duration& operator--();
+ __duration__& operator--();
[*Effects:] `--rep_`.
@@ -3025,14 +3152,14 @@
[endsect]
[section:duration_operator_mm2 Member function `operator++(int)`]
- duration operator--(int);
+ __duration__ operator--(int);
-[*Returns:] `duration(rep_--)`.
+[*Returns:] `__duration__(rep_--)`.
[endsect]
[section:duration_operator_pa Member function `operator+=(const duration&)`]
- duration& operator+=(const duration& d);
+ __duration__& operator+=(const __duration__& d);
[*Effects:] `rep_ += d.count()`.
@@ -3041,7 +3168,7 @@
[endsect]
[section:duration_operator_ma Member function `operator-=(const duration&)`]
- duration& operator-=(const duration& d);
+ __duration__& operator-=(const __duration__& d);
[*Effects:] `rep_ -= d.count()`.
@@ -3050,7 +3177,7 @@
[endsect]
[section:duration_operator_moda Member function `operator%=(const duration&)`]
- duration& operator%=(const duration& d);
+ __duration__& operator%=(const __duration__& d);
[*Effects:] `rep_ %= d.count()`.
@@ -3059,7 +3186,7 @@
[endsect]
[section:duration_operator_proda Member function `operator*=(const rep&)`]
- duration& operator*=(const rep& rhs);
+ __duration__& operator*=(const rep& rhs);
[*Effects:] `rep_ *= rhs`.
@@ -3068,7 +3195,7 @@
[endsect]
[section:duration_operator_da Member function `operator/=(const rep&)`]
- duration& operator/=(const rep& rhs);
+ __duration__& operator/=(const rep& rhs);
[*Effects:] `rep_ /= rhs`.
@@ -3077,7 +3204,7 @@
[endsect]
[section:duration_operator_moda_2 Member function `operator%=(const rep&)`]
- duration& operator%=(const rep& rhs);
+ __duration__& operator%=(const rep& rhs);
[*Effects:] `rep_ %= rhs`.
@@ -3088,36 +3215,36 @@
[section:duration_zero Static Member function `zero()`]
- static duration zero();
+ static __duration__ zero();
-[*Returns:] `duration(duration_values<rep>::zero())`.
+[*Returns:] `__duration__(__duration_values__<rep>::zero())`.
[endsect]
[section:duration_min Static Member function `min()`]
- static duration min();
+ static __duration__ min();
-[*Returns:] `duration(duration_values<rep>::min()).`
+[*Returns:] `__duration__(__duration_values__<rep>::min()).`
[endsect]
[section:duration_max Static Member function `max()`]
- static constexpr duration max();
+ static constexpr __duration__ max();
-[*Returns:] `duration(duration_values<rep>::max())`.
+[*Returns:] `__duration__(__duration_values__<rep>::max())`.
[endsect]
[endsect]
-[section duration non-member arithmetic]
+[section `duration` non-member arithmetic]
[section:duration_operator_p_1 Non-Member function `operator+(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
- operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<__duration__<Rep1, Period1>, __duration__<Rep2, Period2> >::type
+ operator+(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] `CD(lhs) += rhs` where `CD` is the type of the return value.
@@ -3125,25 +3252,25 @@
[section:duration_operator_m_1 Non-Member function `operator-(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
- operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<__duration__<Rep1, Period1>, __duration__<Rep2, Period2> >::type
+ operator-(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] `CD(lhs) -= rhs` where `CD` is the type of the return value.
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator*(const duration<Rep1, Period>& d, const Rep2& s);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator*(const __duration__<Rep1, Period>& d, const Rep2& s);
[*Requires:] Let `CR` represent the __common_type__ of `Rep1` and `Rep2`. This function will not participate in overload resolution unless both `Rep1` and `Rep2` are implicitly convertible to `CR`.
-[*Returns:] `duration<CR, Period>(d) *= s`.
+[*Returns:] `__duration__<CR, Period>(d) *= s`.
[endsect]
[section:duration_operator_prod_1 Non-Member function `operator*(Rep1,duration)`]
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator*(const Rep1& s, const duration<Rep2, Period>& d);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator*(const Rep1& s, const __duration__<Rep2, Period>& d);
[*Requires:] Let `CR` represent the __common_type__ of `Rep1` and `Rep2`. This function will not participate in overload resolution unless both `Rep1` and `Rep2` are implicitly convertible to `CR`.
@@ -3153,19 +3280,19 @@
[section:duration_operator_d_1 Non-Member function `operator/(duration,Rep2)`]
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator/(const duration<Rep1, Period>& d, const Rep2& s);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator/(const __duration__<Rep1, Period>& d, const Rep2& s);
[*Requires:] Let `CR` represent the __common_type__ of `Rep1` and `Rep2`. This function will not participate in overload resolution unless both `Rep1` and `Rep2` are implicitly convertible to `CR`, and `Rep2` is not an instantiation of __duration__.
-[*Returns:] `duration<CR, Period>(d) /= s`.
+[*Returns:] `__duration__<CR, Period>(d) /= s`.
[endsect]
[section:duration_operator_d_2 Non-Member function `operator/(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<Rep1, Rep2>::type
- operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<Rep1, Rep2>::type
+ operator/(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] Let `CD` represent the __common_type__ of the two __duration__ arguments. Returns `CD(lhs).count() / CD(rhs).count()`.
@@ -3174,11 +3301,11 @@
[section:duration_operator_d_3 Non-Member function `operator/(Rep1,duration)`]
template <class Rep1, class Rep2, class Period>
- double operator/(const Rep1& s, const duration<Rep2, Period>& d);
+ double operator/(const Rep1& s, const __duration__<Rep2, Period>& d);
[*Remarks:] Let `CR` represent the __common_type__ of `Rep1` and `Rep2`. This function will not participate in overload resolution unless both `Rep1` and `Rep2` are implicitly convertible to `CR`, and `Rep1` is not an instantiation of __duration__.
-[*Returns:] `CR(s)/duration<CR, Period>(d)`.
+[*Returns:] `CR(s)/__duration__<CR, Period>(d)`.
[endsect]
@@ -3186,19 +3313,19 @@
[section:duration_operator_mod_1 Non-Member function `operator%(duration,Rep2)`]
template <class Rep1, class Period, class Rep2>
- duration<typename common_type<Rep1, Rep2>::type, Period>
- operator%(const duration<Rep1, Period>& d, const Rep2& s);
+ __duration__<typename __common_type__<Rep1, Rep2>::type, Period>
+ operator%(const __duration__<Rep1, Period>& d, const Rep2& s);
-[*Remarks] This function will not participate in overload resolution unless Rep2 must be implicitly convertible to CR(Rep1, Rep2) and Rep2 must not be an instantiation of duration.
+[*Remarks] This function will not participate in overload resolution unless Rep2 must be implicitly convertible to CR(Rep1, Rep2) and Rep2 must not be an instantiation of __duration__.
-[*Returns:] duration<CR(Rep1,Rep2), Period>(d) %= s.
+[*Returns:] __duration__<CR(Rep1,Rep2), Period>(d) %= s.
[endsect]
[section:duration_operator_mod_2 Non-Member function `operator%(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2> >::type
- operator%(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ typename __common_type__<__duration__<Rep1, Period1>, __duration__<Rep2, Period2> >::type
+ operator%(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Remarks] This function will not participate in overload resolution unless
@@ -3207,12 +3334,12 @@
[endsect]
[endsect]
-[section duration comparaisons]
+[section `duration` Non-Member comparaisons]
[section:duration_operator_eq_1 Non-Member function `operator==(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator==(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] Let `CD` represent the __common_type__ of the two __duration__ arguments. Returns `CD(lhs).count() == CD(rhs).count()`
@@ -3220,7 +3347,7 @@
[section:duration_operator_neq_1 Non-Member function `operator!=(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator!=(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] `!(lhs == rhs)`.
@@ -3228,7 +3355,7 @@
[section:duration_operator_lt_1 Non-Member function `operator<(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator< (const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] Let `CD` represent the __common_type__ of the two __duration__ arguments. Returns `CD(lhs).count() < CD(rhs).count()`
@@ -3236,7 +3363,7 @@
[section:duration_operator_leq_1 Non-Member function `operator<=(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator<=(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] `!(rhs < lhs)`.
@@ -3244,7 +3371,7 @@
[section:duration_operator_gt_1 Non-Member function `operator>(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator> (const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] `rhs < lhs`.
@@ -3252,7 +3379,7 @@
[section:duration_operator_gteq_1 Non-Member function `operator>=(duration,duration)`]
template <class Rep1, class Period1, class Rep2, class Period2>
- bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
+ bool operator>=(const __duration__<Rep1, Period1>& lhs, const __duration__<Rep2, Period2>& rhs);
[*Returns:] `!(lhs < rhs)`.
@@ -3261,7 +3388,7 @@
[section:duration_cast Non-Member function `duration_cast(duration)`]
template <class ToDuration, class Rep, class Period>
- ToDuration duration_cast(const duration<Rep, Period>& d);
+ ToDuration duration_cast(const __duration__<Rep, Period>& d);
[*Requires:] This function will not participate in overload resolution unless `ToDuration` is an instantiation of __duration__.
@@ -3305,11 +3432,7 @@
// conversions
template <class Duration2>
- time_point(const time_point<clock, Duration2>& t,
- typename boost::enable_if
- <
- boost::is_convertible<Duration2, duration>
- >::type* = 0);
+ time_point(const __time_point__<clock, Duration2>& t);
// observer
@@ -3346,7 +3469,7 @@
[endsect]
[section:time_point_c_3 Constructor `time_point(const duration&)`]
- template <class Duration2> time_point(const time_point<clock, Duration2>& t);
+ template <class Duration2> time_point(const __time_point__<clock, Duration2>& t);
[*Requires:] This function will not participate in overload resolution unless `Duration2` is implicitly convertible to __duration__.
@@ -3396,14 +3519,14 @@
[endsect]
-[section time_point non-member arithmetic]
+[section `time_point` non-member arithmetic]
[section:time_point_operator_p_1 Non-Member function `operator+(time_point,duration)`]
template <class Clock, class Duration1, class Rep2, class Period2>
- time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2> >::type>
- operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
+ __time_point__<Clock, typename __common_type__<Duration1, duration<Rep2, Period2> >::type>
+ operator+(const __time_point__<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
[*Returns:] `CT(lhs) += rhs` where `CT` is the type of the return value.
@@ -3411,8 +3534,8 @@
[section:time_point_operator_p_2 Non-Member function `operator+(duration,time_point)`]
template <class Rep1, class Period1, class Clock, class Duration2>
- time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type>
- operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs);
+ __time_point__<Clock, typename __common_type__<duration<Rep1, Period1>, Duration2>::type>
+ operator+(const duration<Rep1, Period1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `rhs + lhs`.
@@ -3420,8 +3543,8 @@
[section:time_point_operator_m_1 Non-Member function `operator-(time_point,duration)`]
template <class Clock, class Duration1, class Rep2, class Period2>
- time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2> >::type>
- operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
+ __time_point__<Clock, typename __common_type__<Duration1, duration<Rep2, Period2> >::type>
+ operator-(const __time_point__<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs);
[*Returns:] `lhs + (-rhs)`.
@@ -3429,19 +3552,19 @@
[section:time_point_operator_m_2 Non-Member function `operator-(duration,time_point)`]
template <class Clock, class Duration1, class Duration2>
- typename common_type<Duration1, Duration2>::type
- operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ typename __common_type__<Duration1, Duration2>::type
+ operator-(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `lhs.time_since_epoch() - rhs.time_since_epoch()`.
[endsect]
[endsect]
-[section time_point comparisons]
+[section `time_point` non-member comparisons]
[section:time_point_operator_eq Non-Member function `operator==(time_point,time_point)`]
template <class Clock, class Duration1, class Duration2>
- bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator==(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `lhs.time_since_epoch() == rhs.time_since_epoch()`.
@@ -3449,7 +3572,7 @@
[section:time_point_operator_neq Non-Member function `operator!=(time_point,time_point)`]
template <class Clock, class Duration1, class Duration2>
- bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator!=(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `!(lhs == rhs)`.
@@ -3457,7 +3580,7 @@
[section:time_point_operator_lt Non-Member function `operator<(time_point,time_point)`]
template <class Clock, class Duration1, class Duration2>
- bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator< (const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] lhs.time_since_epoch() < rhs.time_since_epoch().
@@ -3465,7 +3588,7 @@
[section:time_point_operator_leq Non-Member function `operator<=(time_point,time_point)`]
template <class Clock, class Duration1, class Duration2>
- bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator<=(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `!(rhs < lhs)`.
@@ -3473,7 +3596,7 @@
[section:time_point_operator_gt Non-Member function `operator>(time_point,time_point)`]
template <class Clock, class Duration1, class Duration2>
- bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator> (const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `rhs < lhs`.
@@ -3481,23 +3604,36 @@
[section:time_point_operator_geq Non-Member function `operator>=(time_point,time_point)`]
template <class Clock, class Duration1, class Duration2>
- bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
+ bool operator>=(const __time_point__<Clock, Duration1>& lhs, const __time_point__<Clock, Duration2>& rhs);
[*Returns:] `!(lhs < rhs)`.
[endsect]
+[endsect]
+
[section:time_point_cast Non-Member function `time_point_cast(time_point)`]
template <class ToDuration, class Clock, class Duration>
- time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t);
+ __time_point__<Clock, ToDuration> time_point_cast(const __time_point__<Clock, Duration>& t);
[*Requires:] This function will not participate in overload resolution unless `ToDuration` is an instantiation of __duration__.
-[*Returns:] `time_point<Clock, ToDuration>(duration_cast<ToDuration>(t.time_since_epoch()))`.
+[*Returns:] `__time_point__<Clock, ToDuration>(duration_cast<ToDuration>(t.time_since_epoch()))`.
[endsect]
-[endsect]
+[section:duration_typedefs `duration` typedefs]
+
+ // convenience typedefs
+ typedef __duration__<boost::int_least64_t, nano> nanoseconds; // at least 64 bits needed
+ typedef __duration__<boost::int_least64_t, micro> microseconds; // at least 55 bits needed
+ typedef __duration__<boost::int_least64_t, milli> milliseconds; // at least 45 bits needed
+ typedef __duration__<boost::int_least64_t> seconds; // at least 35 bits needed
+ typedef __duration__<boost::int_least32_t, __ratio__< 60> > minutes; // at least 29 bits needed
+ typedef __duration__<boost::int_least32_t, __ratio__<3600> > hours; // at least 23 bits needed
+
+
+[endsect]
[section:system_clock Class `system_clock`]
@@ -3508,7 +3644,7 @@
typedef BOOST_SYSTEM_CLOCK_DURATION duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<system_clock> time_point;
+ typedef chrono::__time_point__<system_clock> time_point;
static const bool is_monotonic = false;
static time_point now(); // throws on error
@@ -3557,7 +3693,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<monotonic_clock> time_point;
+ typedef chrono::__time_point__<monotonic_clock> time_point;
static const bool is_monotonic = true;
static time_point now(); // throws on error
@@ -3573,7 +3709,7 @@
`high_resolution_clock` satisfy the __clock_req__.
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef monotonic_clock high_resolution_clock; // as permitted by [time.clock.hires]
#else
typedef system_clock high_resolution_clock; // as permitted by [time.clock.hires]
@@ -3587,7 +3723,7 @@
[section:chrono_typeof_hpp Header `<boost/chrono/typeof/boost/chrono/chrono.hpp>`]
[/=============================================]
-Register `duration<>` and `timepoint<>` class templates to Boost.Typeof.
+Register __duration__`<>` and __timepoint__`<>` class templates to Boost.Typeof.
[endsect]
[endsect]
@@ -3620,7 +3756,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<process_real_cpu_clock> time_point;
+ typedef chrono::__time_point__<process_real_cpu_clock> time_point;
static const bool is_monotonic = true;
static time_point now( system::error_code & ec = system::throws );
@@ -3639,7 +3775,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<process_user_cpu_clock> time_point;
+ typedef chrono::__time_point__<process_user_cpu_clock> time_point;
static const bool is_monotonic = true;
static time_point now( system::error_code & ec = system::throws );
@@ -3659,7 +3795,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<process_system_cpu_clock> time_point;
+ typedef chrono::__time_point__<process_system_cpu_clock> time_point;
static const bool is_monotonic = true;
static time_point now( system::error_code & ec = system::throws );
@@ -3684,14 +3820,14 @@
typedef duration<times, nano> duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<process_cpu_clock> time_point;
+ typedef chrono::__time_point__<process_cpu_clock> time_point;
static const bool is_monotonic = true;
static time_point now( system::error_code & ec = system::throws );
};
template <>
- struct duration_values<process_cpu_clock::times>;
+ struct __duration_values__<process_cpu_clock::times>;
[section:times Class `times`]
@@ -3724,7 +3860,7 @@
[section `duration_values` specialization for `times`]
template <>
- struct duration_values<process_cpu_clock::times>
+ struct __duration_values__<process_cpu_clock::times>
{
static process_cpu_clock::times zero();
static process_cpu_clock::times max();
@@ -3776,7 +3912,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<thread_clock> time_point;
+ typedef chrono::__time_point__<thread_clock> time_point;
static const bool is_monotonic = BOOST_CHRONO_THREAD_CLOCK_IS_MONOTONIC;
static time_point now( system::error_code & ec = system::throws );
@@ -3901,7 +4037,7 @@
typedef typename Clock::duration duration;
typedef typename Clock::rep rep;
typedef typename Clock::period period;
- typedef chrono::time_point<suspendible_clock<Clock> > time_point;
+ typedef chrono::__time_point__<suspendible_clock<Clock> > time_point;
static const bool is_monotonic = true;
static time_point now( system::error_code & ec = system::throws );
@@ -4069,7 +4205,7 @@
};
typedef <see above> system_stopwatch;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __
typedef <see above> monotonic_stopwatch;
#endif
typedef <see above> high_resolution_stopwatch;
@@ -4129,10 +4265,10 @@
[endsect]
-[section:stopwatch_typedefs __stopwatch__ useful typedefs]
+[section:stopwatch_typedefs `stopwatch` useful typedefs]
typedef boost::chrono::stopwatch< boost::chrono::system_clock > system_stopwatch;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::stopwatch< boost::chrono::monotonic_clock > monotonic_stopwatch;
#endif
typedef boost::chrono::stopwatch< boost::chrono::high_resolution_clock > high_resolution_stopwatch;
@@ -4162,7 +4298,7 @@
};
typedef <see below> system_stopwatch_accumulator;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef <see below> monotonic_stopwatch_accumulator;
#endif
typedef <see below> high_resolution_stopwatch_accumulator;
@@ -4176,7 +4312,7 @@
[section:stopwatch_accumulator Template Class `stopwatch_accumulator<>`]
-A `stopwatch_accumulator<>` is a model of a __stopwatch_concept__ that allows to accumulate the time in several times instead of at once as it is the case of the class `stopwatch<>`.
+A `stopwatch_accumulator<>` is a model of a __stopwatch_concept__ that allows to accumulate the time in several times instead of at once as it is the case of the class __stopwatch__`<>`.
template <class Clock> class stopwatch_accumulator {
public:
@@ -4297,12 +4433,12 @@
[endsect]
-[section:stopwatch_accumulator_typedefs __stopwatch_accumulator__ useful typedefs]
+[section:stopwatch_accumulator_typedefs `stopwatch_accumulator` useful typedefs]
typedef boost::chrono::stopwatch_accumulator< boost::chrono::system_clock > system_stopwatch_accumulator;
-#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::stopwatch_accumulator< boost::chrono::monotonic_clock > monotonic_stopwatch_accumulator;
-#endif
+ #endif
typedef boost::chrono::stopwatch_accumulator< boost::chrono::high_resolution_clock > high_resolution_stopwatch_accumulator;
typedef boost::chrono::stopwatch_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_stopwatch_accumulator;
@@ -4684,7 +4820,7 @@
template < class Clock, class Formatter > class wstopclock;
typedef <see above> system_stopclock;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef <see above> monotonic_stopclock;
#endif
typedef <see above> high_resolution_stopclock;
@@ -4693,7 +4829,7 @@
typedef <see above> process_system_cpu_stopclock;
typedef <see above> system_wstopclock;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef <see above> monotonic_wstopclock;
#endif
typedef <see above> high_resolution_wstopclock;
@@ -4794,7 +4930,7 @@
[section:stopclock_typedefs `stopclock` useful typedefs]
typedef boost::chrono::stopclock< boost::chrono::system_clock > system_stopwatch_stopclock;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::stopclock< boost::chrono::monotonic_clock > monotonic_stopwatch_stopclock;
#endif
typedef boost::chrono::stopclock< boost::chrono::high_resolution_clock > high_resolution_stopclock;
@@ -4852,7 +4988,7 @@
[section:wstopclock_typedefs `wstopclock` useful typedefs]
typedef boost::chrono::wstopclock< boost::chrono::system_clock > system_stopwatch_wstopclock;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::wstopclock< boost::chrono::monotonic_clock > monotonic_stopwatch_wstopclock;
#endif
typedef boost::chrono::wstopclock< boost::chrono::high_resolution_clock > high_resolution_wstopclock;
@@ -4878,7 +5014,7 @@
class wstopclock_accumulator;
typedef <see above> system_stopclock_accumulator;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef <see above> monotonic_stopclock_accumulator;
#endif
typedef <see above> high_resolution_stopclock_accumulator;
@@ -4887,7 +5023,7 @@
typedef <see above> process_system_cpu_stopclock_accumulator;
typedef <see above> system_wstopclock_accumulator;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef <see above> monotonic_wstopclock_accumulator;
#endif
typedef <see above> high_resolution_wstopclock_accumulator;
@@ -4992,7 +5128,7 @@
[section:stopclock_accumulator_typedefs `stopclock_accumulator` useful typedefs]
typedef boost::chrono::stopclock_accumulator< boost::chrono::system_clock > system_stopclock_accumulator;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::stopclock_accumulator< boost::chrono::monotonic_clock > monotonic_stopclock_accumulator;
#endif
typedef boost::chrono::stopclock_accumulator< boost::chrono::high_resolution_clock > high_resolution_stopclock_accumulator;
@@ -5050,7 +5186,7 @@
[section:wstopclock_accumulator_typedefs `wstopclock_accumulator` useful typedefs]
typedef boost::chrono::wstopclock_accumulator< boost::chrono::system_clock > system_wstopclock_accumulator;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::wstopclock_accumulator< boost::chrono::monotonic_clock > monotonic_wstopclock_accumulator;
#endif
typedef boost::chrono::wstopclock_accumulator< boost::chrono::high_resolution_clock > high_resolution_wstopclock_accumulator;
@@ -5323,7 +5459,7 @@
class t24_hours {
public:
- typedef boost::chrono::duration<boost::int_least32_t, ratio<24*3600> > days;
+ typedef boost::chrono::duration<boost::int_least32_t, __ratio__<24*3600> > days;
typedef boost::chrono::hours hours;
typedef boost::chrono::minutes minutes;
typedef boost::chrono::seconds seconds;
@@ -5401,7 +5537,7 @@
namespace boost { namespace chrono {
template <class Clock=high_resolution_clock> class timer;
typedef <see above> system_timer;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef <see above> monotonic_timer;
#endif
typedef <see above> high_resolution_timer;
@@ -5440,7 +5576,7 @@
[section:timer_typedefs `timer` useful typedefs]
typedef boost::chrono::timer< boost::chrono::system_clock > system_timer;
- #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ #ifdef __BOOST_CHRONO_HAS_CLOCK_MONOTONIC
typedef boost::chrono::timer< boost::chrono::monotonic_clock > monotonic_timer;
#endif
typedef boost::chrono::timer< boost::chrono::high_resolution_clock > high_resolution_timer;
@@ -5483,7 +5619,7 @@
typedef nanoseconds duration;
typedef duration::rep rep;
typedef duration::period period;
- typedef chrono::time_point<process_clock> time_point;
+ typedef chrono::__time_point__<process_clock> time_point;
static const bool is_monotonic = true;
struct process_times;
@@ -5746,13 +5882,13 @@
[*Bug Fixes]
* Replace `INTMAX_C` by `BOOST_INTMAX_C` until `boost/cstdint.hpp` ensures `INTMAX_C` is always defined.
-* Define `BOOST_CHRONO_HAS_CLOCK_MONOTONIC` when `BOOST_CHRONO_WINDOWS_API`
+* Define __BOOST_CHRONO_HAS_CLOCK_MONOTONIC__ when `BOOST_CHRONO_WINDOWS_API`
* Commenting invalid operator declarations
* Take care of Boost `min`/`max` recommendations
* Complete qualification when defining nested typedef duration on clocks to avoid the following compile error:
- ./boost/chrono/chrono.hpp:945: error: declaration of 'typedef class boost::chrono::duration<long long int, boost::ratio<1ll, 10000000ll> > boost::chrono::system_clock::duration'
- ./boost/chrono/chrono.hpp:458: error: changes meaning of 'duration' from 'class boost::chrono::duration<long long int, boost::ratio<1ll, 10000000ll> >'
+ ./boost/chrono/chrono.hpp:945: error: declaration of 'typedef class boost::chrono::duration<long long int, boost::__ratio__<1ll, 10000000ll> > boost::chrono::system_clock::duration'
+ ./boost/chrono/chrono.hpp:458: error: changes meaning of 'duration' from 'class boost::chrono::duration<long long int, boost::__ratio__<1ll, 10000000ll> >'
* cleanup of simulated...
* warning removal on `posix/process_clock.cpp`.
@@ -5776,7 +5912,7 @@
* 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 __BOOST_CHRONO_HAS_CLOCK_MONOTONIC__ macro to state if __monotonic_clock__ is provided on this platform.
* Added __duration__ `operator%` ([@http://home.roadrunner.com/~hinnant/issue_review/lwg-defects.html#934 [*LGW 934. duration is missing operator%]])
* Added BOOST_CHRONO_CONSTEXPR when constexpr should be used.
* Complete __duration__ `operator*` and `operator/`.
@@ -5798,7 +5934,7 @@
[*Bug Fixes]
* `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.
+* `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_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
@@ -5870,29 +6006,29 @@
This simple example
- ratio<1,3> r1;
- ratio<3,9> r2;
+ __ratio__<1,3> r1;
+ __ratio__<3,9> r2;
r1 = r2; // (1)
fails to compile in (1). Other example
- ratio<1,3> r1;
- ratio_substract<ratio<2,3>,ratio<1,3> > r2=r1; // (2)
+ __ratio__<1,3> r1;
+ ratio_substract<__ratio__<2,3>,__ratio__<1,3> > r2=r1; // (2)
-The type of ratio_substract<ratio<2,3>,ratio<1,3> > could be ratio<3,9> so the compilation could fail in (2). It could also be ratio<1,3> and the compilation succeeds.
+The type of ratio_substract<__ratio__<2,3>,__ratio__<1,3> > 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.]
+['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 should be a normalized ratio equivalent to ratio<T1, T2>, but there is not an explicit definition of what synonym means in this context.
+The meaning of synonym let think that the result should 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;
+ __ratio__<1,3>::type r1;
+ __ratio__<3,9>::type r2;
r1 = r2; // compiles as both types are the same.
@@ -5908,10 +6044,10 @@
[/======================================================]
[section:faq Appendix D: FAQ]
-[heading How important is the order of the common_type<> template arguments?]
+[heading How important is the order of the __common_type__<> template arguments?]
-The order of the template parameters is important. First common_type<> is not able to find out common type if it is not present and second
-common_type<A,B,C>::type is equivalent to common_type<common_type<A,B>::type, C>::type.
+The order of the template parameters is important. First __common_type__<> is not able to find out common type if it is not present and second
+__common_type__<A,B,C>::type is equivalent to __common_type__<__common_type__<A,B>::type, C>::type.
struct A {};
@@ -5926,13 +6062,13 @@
};
#if 0
- typedef boost::common_type<A, B, C>::type ABC; // DO not compile
+ typedef boost::__common_type__<A, B, C>::type ABC; // DO not compile
#else
- typedef boost::common_type<C, B, A>::type ABC;
+ typedef boost::__common_type__<C, B, A>::type ABC;
#endif
-Thus, as common_type<A,B>::type is undefined, common_type<A,B,C>::type is also undefined.
+Thus, as __common_type__<A,B>::type is undefined, __common_type__<A,B,C>::type is also undefined.
[heading Why does stopwatch_reporter only display millisecond place precision when the underlying Clock has nanosecond precision?]
@@ -5948,11 +6084,11 @@
[heading What happens if I press Ctrl+C and program terminates? What log would Boost.chrono output?]
-[heading Can you explain the pros/cons of common_type against Boost.Typeof?]
+[heading Can you explain the pros/cons of __common_type__ against Boost.Typeof?]
-Even if in a first look they sound to be close, common_type and typeof have
+Even if in a first look they sound to be close, __common_type__ and typeof have
different purposes. You use typeof to get the type of an expression, while
-you use common_type to set explicitly the type returned of a template
+you use __common_type__ to set explicitly the type returned of a template
function. Both are complementary. For example with the preceding declaration
and the needed Typeof registrations, you can do
@@ -5966,7 +6102,7 @@
}
-common_type is closer in nature to promote_args<class ...T> in boost/math/tools/promotion.hpp than it is to Boost.Typeof, though it is not exactly the same as promote_args either. common_type<T1, T2>::type simply represents the result of some operation on T1 and T2, and defaults to the type obtained by putting T1 and T2 into a conditional statement.
+__common_type__ is closer in nature to promote_args<class ...T> in boost/math/tools/promotion.hpp than it is to Boost.Typeof, though it is not exactly the same as promote_args either. __common_type__<T1, T2>::type simply represents the result of some operation on T1 and T2, and defaults to the type obtained by putting T1 and T2 into a conditional statement.
It is meant to be customizable (via specialization) if this default is not appropriate.
@@ -6002,10 +6138,10 @@
You can also run a specific suite of test by doing
cd libs/chrono/test
- bjam common_type
+ bjam __common_type__
-[section __common_type__]
+[section `common_type`]
[table
[[Name] [kind] [Description] [Result] [Ticket]]
[[common_type_test] [run] [...] [Pass] [#]]
@@ -6026,7 +6162,7 @@
[[chrono_unit_test] [run] [...] [Pass] [#]]
[[explore_limits] [run] [...] [Pass] [#]]
[[test_duration] [run] [...] [Pass] [#]]
- [[test_system_clock] [run] [...] [Pass] [#]]
+ [[test_clock] [run] [...] [Pass] [#]]
[[miscellaneous] [run] [...] [Pass] [#]]
[[test_special_values] [run] [...] [Pass] [#]]
[[manipulate_clock_object] [run] [...] [Pass] [#]]
@@ -6048,6 +6184,7 @@
[table
[[Name] [kind] [Description] [Result] [Ticket]]
[[test_suspendible_clock] [run] [test basic uses of suspendible_clock.] [Pass] [#]]
+ [[test_thread_clock] [run] [test basic uses of thread_clock.] [Pass] [#]]
]
[endsect]
@@ -6056,16 +6193,16 @@
[[Name] [kind] [Description] [Result] [Ticket]]
[[test_min_max] [compile] [test compilation succeeds in the presence of macros min and max.] [Pass] [#]]
[[stopwatch_example] [run] [...] [Pass] [#]]
- [[stopwatch_example] [run] [...] [Pass] [#]]
[[scoped_stopwatch_example] [run] [...] [Pass] [#]]
[[stopwatch_accumulator_example] [run] [...] [Pass] [#]]
[[specific_stopwatch_accumulator_example] [run] [...] [Pass] [#]]
[[stopclock_example] [run] [...] [Pass] [#]]
[[stopclock_accumulator_example] [run] [...] [Pass] [#]]
[[nested_stopclock_accumulator_example] [run] [...] [Pass] [#]]
+ [[loop_stopclock_accumulator_example] [run] [...] [Pass] [#]]
[[t24_hours_example] [run] [...] [Pass] [#]]
[[scoped_stopclock_example] [run] [...] [Pass] [#]]
- [[test_minmax] [compile] [...] [Pass] [#]]
+ [[timex] [link] [...] [Pass] [#]]
[[stopclock_constructor_overload_test] [run] [...] [Pass] [#]]
[[wstopclock_constructor_overload_test] [run] [...] [Pass] [#]]
@@ -6216,7 +6353,7 @@
[heading For later releases]
* Use of C++0x feature constexpr, when available.
-* Define a C++98 variadic template emmulation of common_type
+* Define a C++98 variadic template emmulation of __common_type__
[endsect]
[endsect]
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -60,8 +60,7 @@
Acknowledgements</a></span></dt>
<dt><span class="section"> Appendix F: Tests</span></dt>
<dd><dl>
-<dt><span class="section"><a href="appendices/tests.html#boost_chrono.appendices.tests.__common_type__"> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a></a></span></dt>
+<dt><span class="section">common_type
</span></dt>
<dt><span class="section">ratio
</span></dt>
<dt><span class="section">chrono</span></dt>
<dt><span class="section">Other Clocks</span></dt>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/faq.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -28,15 +28,20 @@
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_chrono.appendices.faq"></a> Appendix D: FAQ
</h3></div></div></div>
-<a name="boost_chrono.appendices.faq.how_important_is_the_order_of_the_common_type_lt__gt__template_arguments_"></a><h4>
-<a name="id4940360"></a>
- <a href="faq.html#boost_chrono.appendices.faq.how_important_is_the_order_of_the_common_type_lt__gt__template_arguments_">How
- important is the order of the common_type<> template arguments?</a>
+<a name="boost_chrono.appendices.faq.how_important_is_the_order_of_the___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__lt__gt__template_arguments_"></a><h4>
+<a name="id4944873"></a>
+ <a href="faq.html#boost_chrono.appendices.faq.how_important_is_the_order_of_the___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__lt__gt__template_arguments_">How
+ important is the order of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><> template arguments?</a>
</h4>
<p>
- The order of the template parameters is important. First common_type<>
- is not able to find out common type if it is not present and second common_type<A,B,C>::type
- is equivalent to common_type<common_type<A,B>::type, C>::type.
+ The order of the template parameters is important. First <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><> is not able
+ to find out common type if it is not present and second <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><A,B,C>::type is
+ equivalent to <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>< <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><A,B>::type, C>::type.
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">A</span> <span class="special">{};</span>
<span class="keyword">struct</span> <span class="identifier">B</span> <span class="special">{};</span>
@@ -50,17 +55,22 @@
<span class="special">};</span>
<span class="preprocessor">#if</span> <span class="number">0</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">common_type</span><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">,</span> <span class="identifier">C</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">ABC</span><span class="special">;</span> <span class="comment">// DO not compile
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">A</span><span class="special">,</span> <span class="identifier">B</span><span class="special">,</span> <span class="identifier">C</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">ABC</span><span class="special">;</span> <span class="comment">// DO not compile
</span><span class="preprocessor">#else</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">common_type</span><span class="special"><</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">B</span><span class="special">,</span> <span class="identifier">A</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">ABC</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">B</span><span class="special">,</span> <span class="identifier">A</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">ABC</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
</pre>
<p>
- Thus, as common_type<A,B>::type is undefined, common_type<A,B,C>::type
- is also undefined.
+ Thus, as <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><A,B>::type is
+ undefined, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><A,B,C>::type is
+ also undefined.
</p>
<a name="boost_chrono.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_clock_has_nanosecond_precision_"></a><h4>
-<a name="id4940770"></a>
+<a name="id4945427"></a>
<a href="faq.html#boost_chrono.appendices.faq.why_does_stopwatch_reporter_only_display_millisecond_place_precision_when_the_underlying_clock_has_nanosecond_precision_">Why
does stopwatch_reporter only display millisecond place precision when the
underlying Clock has nanosecond precision?</a>
@@ -71,7 +81,7 @@
dangerously.
</p>
<a name="boost_chrono.appendices.faq.why_does_stopwatch_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_"></a><h4>
-<a name="id4940812"></a>
+<a name="id4945468"></a>
<a href="faq.html#boost_chrono.appendices.faq.why_does_stopwatch_reporter_sometimes_report_more_cpu_seconds_than_real_seconds_">Why
does stopwatch_reporter sometimes report more cpu seconds than real seconds?</a>
</h4>
@@ -81,7 +91,7 @@
be reporting at times.
</p>
<a name="boost_chrono.appendices.faq.can_i_obtain_statistics_of_the_time_elapsed_between_calls_to_a_function_"></a><h4>
-<a name="id4940845"></a>
+<a name="id4945502"></a>
<a href="faq.html#boost_chrono.appendices.faq.can_i_obtain_statistics_of_the_time_elapsed_between_calls_to_a_function_">Can
I obtain statistics of the time elapsed between calls to a function?</a>
</h4>
@@ -89,22 +99,26 @@
The library do not provides this feature.
</p>
<a name="boost_chrono.appendices.faq.what_happens_if_i_press_ctrl_c_and_program_terminates__what_log_would_boost_chrono_output_"></a><h4>
-<a name="id4940874"></a>
+<a name="id4945530"></a>
<a href="faq.html#boost_chrono.appendices.faq.what_happens_if_i_press_ctrl_c_and_program_terminates__what_log_would_boost_chrono_output_">What
happens if I press Ctrl+C and program terminates? What log would Boost.chrono
output?</a>
</h4>
-<a name="boost_chrono.appendices.faq.can_you_explain_the_pros_cons_of_common_type_against_boost_typeof_"></a><h4>
-<a name="id4940903"></a>
- <a href="faq.html#boost_chrono.appendices.faq.can_you_explain_the_pros_cons_of_common_type_against_boost_typeof_">Can
- you explain the pros/cons of common_type against Boost.Typeof?</a>
+<a name="boost_chrono.appendices.faq.can_you_explain_the_pros_cons_of___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__against_boost_typeof_"></a><h4>
+<a name="id4945560"></a>
+ <a href="faq.html#boost_chrono.appendices.faq.can_you_explain_the_pros_cons_of___link_linkend__boost_chrono_reference_cpp0x_common_type_hpp_common_type___code__phrase_role__identifier__common_type__phrase___code___link__against_boost_typeof_">Can
+ you explain the pros/cons of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> against Boost.Typeof?</a>
</h4>
<p>
- Even if in a first look they sound to be close, common_type and typeof have
- different purposes. You use typeof to get the type of an expression, while
- you use common_type to set explicitly the type returned of a template function.
- Both are complementary. For example with the preceding declaration and the
- needed Typeof registrations, you can do
+ Even if in a first look they sound to be close, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> and typeof have different
+ purposes. You use typeof to get the type of an expression, while you use
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> to set explicitly the
+ type returned of a template function. Both are complementary. For example
+ with the preceding declaration and the needed Typeof registrations, you can
+ do
</p>
<p>
Suppose I have a mixed type vector2 class with a magnitude_squared function
@@ -116,11 +130,14 @@
v.x + v.y * v.y; }
</p>
<p>
- common_type is closer in nature to promote_args<class ...T> in boost/math/tools/promotion.hpp
- than it is to Boost.Typeof, though it is not exactly the same as promote_args
- either. common_type<T1, T2>::type simply represents the result of some
- operation on T1 and T2, and defaults to the type obtained by putting T1 and
- T2 into a conditional statement.
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is closer in nature
+ to promote_args<class ...T> in boost/math/tools/promotion.hpp than
+ it is to Boost.Typeof, though it is not exactly the same as promote_args
+ either. <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><T1, T2>::type
+ simply represents the result of some operation on T1 and T2, and defaults
+ to the type obtained by putting T1 and T2 into a conditional statement.
</p>
<p>
It is meant to be customizable (via specialization) if this default is not
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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -166,13 +166,16 @@
</p>
<div class="itemizedlist"><ul type="disc">
<li>
-<span class="underline">_SuspendibleClock</span>_ concept + template
+<a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_req" title="
+ SuspendibleClock requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a> concept + template
class _suspendible<span class="underline">clock</span>_.
</li>
<li>
Added <code class="computeroutput"><span class="identifier">scope_suspend</span></code> which
do <code class="computeroutput"><span class="identifier">suspend</span></code>/<code class="computeroutput"><span class="identifier">resume</span></code> if the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock" title="
- Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a> is a model of <span class="underline">_SuspendibleClock</span>_ concept, and nothing otherwise.
+ Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a> is a model of <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_req" title="
+ SuspendibleClock requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a> concept, and
+ nothing otherwise.
</li>
<li>
<a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
@@ -397,7 +400,7 @@
is always defined.
</li>
<li>
- Define <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code>
+ Define __BOOST_CHRONO_HAS_CLOCK<span class="underline">MONOTONIC</span>_
when <code class="computeroutput"><span class="identifier">BOOST_CHRONO_WINDOWS_API</span></code>
</li>
<li>
@@ -411,8 +414,8 @@
to avoid the following compile error:
</li>
</ul></div>
-<pre class="programlisting"><span class="special">./</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">:</span><span class="number">945</span><span class="special">:</span> <span class="identifier">error</span><span class="special">:</span> <span class="identifier">declaration</span> <span class="identifier">of</span> <span class="char">'typedef class boost::chrono::duration<long long int, boost::ratio<1ll, 10000000ll> > boost::chrono::system_clock::duration'</span>
-<span class="special">./</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">:</span><span class="number">458</span><span class="special">:</span> <span class="identifier">error</span><span class="special">:</span> <span class="identifier">changes</span> <span class="identifier">meaning</span> <span class="identifier">of</span> <span class="char">'duration'</span> <span class="identifier">from</span> <span class="char">'class boost::chrono::duration<long long int, boost::ratio<1ll, 10000000ll> >'</span>
+<pre class="programlisting"><span class="special">./</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">:</span><span class="number">945</span><span class="special">:</span> <span class="identifier">error</span><span class="special">:</span> <span class="identifier">declaration</span> <span class="identifier">of</span> <span class="char">'typedef class boost::chrono::duration<long long int, boost::__ratio__<1ll, 10000000ll> > boost::chrono::system_clock::duration'</span>
+<span class="special">./</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">:</span><span class="number">458</span><span class="special">:</span> <span class="identifier">error</span><span class="special">:</span> <span class="identifier">changes</span> <span class="identifier">meaning</span> <span class="identifier">of</span> <span class="char">'duration'</span> <span class="identifier">from</span> <span class="char">'class boost::chrono::duration<long long int, boost::__ratio__<1ll, 10000000ll> >'</span>
</pre>
<div class="itemizedlist"><ul type="disc">
<li>
@@ -473,7 +476,7 @@
having the same normalized form</strong></span></a>)
</li>
<li>
- Added <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code>
+ Added __BOOST_CHRONO_HAS_CLOCK<span class="underline">MONOTONIC</span>_
macro to state if <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a> is provided
on this platform.
@@ -539,8 +542,7 @@
</li>
<li>
<code class="computeroutput"><span class="identifier">CLOCK_MONOTONIC</span></code> is not
- defined with cygwin/gcc 3.4: Disable code when <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code>
- is not defined.
+ defined with cygwin/gcc 3.4: Disable code when __BOOST_CHRONO_HAS_CLOCK<span class="underline">MONOTONIC</span>_ is not defined.
</li>
<li>
result of metafunctions <code class="computeroutput"><span class="identifier">ratio_multiply</span></code>
@@ -568,7 +570,7 @@
<div class="itemizedlist"><ul type="disc">
<li>
The C++0x Standard Library's <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a>.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>.
</li>
<li>
The C++0x Standard Library's compile-time rational arithmetic.
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/perf.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -69,7 +69,7 @@
with a variable lifetime.
</p>
<a name="boost_chrono.appendices.perf.single_threaded_recursive_function"></a><h4>
-<a name="id4944558"></a>
+<a name="id4949355"></a>
<a href="perf.html#boost_chrono.appendices.perf.single_threaded_recursive_function">Single-Threaded
Recursive function</a>
</h4>
@@ -92,7 +92,7 @@
and thread_clock.
</p>
<a name="boost_chrono.appendices.perf.multi_threaded_recursive_function"></a><h4>
-<a name="id4944608"></a>
+<a name="id4949405"></a>
<a href="perf.html#boost_chrono.appendices.perf.multi_threaded_recursive_function">Multi-Threaded
Recursive function</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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -33,7 +33,7 @@
are an extract from this document.
</p>
<a name="boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__to_a_function_with_the_units_being_ambiguous_"></a><h4>
-<a name="id4939135"></a>
+<a name="id4943505"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.is_it_possible_for_the_user_to_pass_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__to_a_function_with_the_units_being_ambiguous_">Is
it possible for the user to pass a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> to a function with the
@@ -46,7 +46,7 @@
<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="id4939234"></a>
+<a name="id4943604"></a>
<a href="rationale.html#boost_chrono.appendices.rationale.why_duration_needs_operator_">Why
duration needs operator%</a>
</h4>
@@ -74,7 +74,7 @@
<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="id4939814"></a>
+<a name="id4944184"></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>
@@ -86,23 +86,30 @@
<p>
This simple example
</p>
-<pre class="programlisting"><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
-<span class="identifier">ratio</span><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">></span> <span class="identifier">r2</span><span class="special">;</span>
+<pre class="programlisting"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
+<a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</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="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"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
-<span class="identifier">ratio_substract</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">>,</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></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)
+<pre class="programlisting"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></span> <span class="identifier">r1</span><span class="special">;</span>
+<span class="identifier">ratio_substract</span><span class="special"><</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">>,</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">></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 ratio_substract<ratio<2,3>,ratio<1,3> > could
- be ratio<3,9> so the compilation could fail in (2). It could also be
- ratio<1,3> and the compilation succeeds.
+ The type of ratio<span class="underline">substract<</span><span class="underline">ratio</span><span class="underline"><2,3>,</span><span class="underline">ratio</span>_<1,3> > could be <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><3,9> so the compilation
+ could fail in (2). It could also be <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><1,3> and the compilation
+ succeeds.
</p>
<a name="boost_chrono.appendices.rationale.why_ratio_needs_the_nested_normalizer_typedef_type"></a><h4>
-<a name="id4940127"></a>
+<a name="id4944593"></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>
@@ -110,22 +117,26 @@
In N3000 20.4.2 and similar clauses
</p>
<p>
- <span class="emphasis"><em>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.</em></span>
+ <span class="emphasis"><em>3 The nested typedef type shall be a synonym for <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><T1, T2> where T1 has
+ the value R1::num * R2::den - R2::num * R1::den and T2 has the value R1::den
+ * R2::den.</em></span>
</p>
<p>
The meaning of synonym let think that the result should be a normalized ratio
- equivalent to ratio<T1, T2>, but there is not an explicit definition
- of what synonym means in this context.
+ equivalent to <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><T1, T2>, 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"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">r1</span><span class="special">;</span>
-<span class="identifier">ratio</span><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">r2</span><span class="special">;</span>
+<pre class="programlisting"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span><span class="number">3</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">r1</span><span class="special">;</span>
+<a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span><span class="number">9</span><span class="special">>::</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>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/appendices/tests.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -28,8 +28,7 @@
<a name="boost_chrono.appendices.tests"></a> Appendix F: Tests
</h3></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="tests.html#boost_chrono.appendices.tests.__common_type__"> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a></a></span></dt>
+<dt><span class="section">common_type
</span></dt>
<dt><span class="section">ratio
</span></dt>
<dt><span class="section">chrono</span></dt>
<dt><span class="section">Other Clocks</span></dt>
@@ -44,12 +43,12 @@
You can also run a specific suite of test by doing
</p>
<pre class="programlisting"><span class="identifier">cd</span> <span class="identifier">libs</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">test</span>
-<span class="identifier">bjam</span> <span class="identifier">common_type</span>
+<span class="identifier">bjam</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>
</pre>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.appendices.tests.__common_type__"></a><a href="tests.html#boost_chrono.appendices.tests.__common_type__" title=" common_type"> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a></a>
+<a name="boost_chrono.appendices.tests._common_type_"></a>common_type
</h4></div></div></div>
<div class="informaltable"><table class="table">
<colgroup>
@@ -336,7 +335,7 @@
<tr>
<td>
<p>
- test_system_clock
+ test_clock
</p>
</td>
<td>
@@ -726,7 +725,8 @@
</p>
</th>
</tr></thead>
-<tbody><tr>
+<tbody>
+<tr>
<td>
<p>
test_suspendible_clock
@@ -752,7 +752,35 @@
#
</p>
</td>
-</tr></tbody>
+</tr>
+<tr>
+<td>
+ <p>
+ test_thread_clock
+ </p>
+ </td>
+<td>
+ <p>
+ run
+ </p>
+ </td>
+<td>
+ <p>
+ test basic uses of thread_clock.
+ </p>
+ </td>
+<td>
+ <p>
+ Pass
+ </p>
+ </td>
+<td>
+ <p>
+ #
+ </p>
+ </td>
+</tr>
+</tbody>
</table></div>
</div>
<div class="section" lang="en">
@@ -852,7 +880,7 @@
<tr>
<td>
<p>
- stopwatch_example
+ scoped_stopwatch_example
</p>
</td>
<td>
@@ -879,7 +907,7 @@
<tr>
<td>
<p>
- scoped_stopwatch_example
+ stopwatch_accumulator_example
</p>
</td>
<td>
@@ -906,7 +934,7 @@
<tr>
<td>
<p>
- stopwatch_accumulator_example
+ specific_stopwatch_accumulator_example
</p>
</td>
<td>
@@ -933,7 +961,7 @@
<tr>
<td>
<p>
- specific_stopwatch_accumulator_example
+ stopclock_example
</p>
</td>
<td>
@@ -960,7 +988,7 @@
<tr>
<td>
<p>
- stopclock_example
+ stopclock_accumulator_example
</p>
</td>
<td>
@@ -987,7 +1015,7 @@
<tr>
<td>
<p>
- stopclock_accumulator_example
+ nested_stopclock_accumulator_example
</p>
</td>
<td>
@@ -1014,7 +1042,7 @@
<tr>
<td>
<p>
- nested_stopclock_accumulator_example
+ loop_stopclock_accumulator_example
</p>
</td>
<td>
@@ -1095,12 +1123,12 @@
<tr>
<td>
<p>
- test_minmax
+ timex
</p>
</td>
<td>
<p>
- compile
+ link
</p>
</td>
<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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -26,7 +26,7 @@
<a name="boost_chrono.appendices.todo"></a> Appendix I: Future plans
</h3></div></div></div>
<a name="boost_chrono.appendices.todo.tasks_to_do_before_review"></a><h4>
-<a name="id4944674"></a>
+<a name="id4949472"></a>
<a href="todo.html#boost_chrono.appendices.todo.tasks_to_do_before_review">Tasks
to do before review</a>
</h4>
@@ -42,7 +42,7 @@
</li>
</ul></div>
<a name="boost_chrono.appendices.todo.for_later_releases"></a><h4>
-<a name="id4944713"></a>
+<a name="id4949511"></a>
<a href="todo.html#boost_chrono.appendices.todo.for_later_releases">For later
releases</a>
</h4>
@@ -51,8 +51,9 @@
Use of C++0x feature constexpr, when available.
</li>
<li>
- Define a C++98 variadic template emmulation of common_type
- </li>
+ Define a C++98 variadic template emmulation of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>
+</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -26,19 +26,7 @@
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_chrono.overview"></a>Overview
</h2></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section">Motivation</span></dt>
-<dd><dl>
-<dt><span class="section"><a href="overview/motivation.html#boost_chrono.overview.motivation.common_type">Common
- type</a></span></dt>
-<dt><span class="section">Ratio</span></dt>
-<dt><span class="section">Duration</span></dt>
-<dt><span class="section">Clocks</span></dt>
-<dt><span class="section">Time Point</span></dt>
-<dt><span class="section">Stopwatches</span></dt>
-</dl></dd>
-<dt><span class="section"> Caveat emptor</span></dt>
-</dl></div>
+<div class="toc"><dl><dt><span class="section">Motivation</span></dt></dl></div>
<div class="blockquote"><blockquote class="blockquote">
<p>
</p>
@@ -69,9 +57,11 @@
<li>
One facility for representing time durations: <a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. Examples of time durations
- include <code class="computeroutput"><span class="identifier">seconds</span></code>, <code class="computeroutput"><span class="identifier">minutes</span></code> and <code class="computeroutput"><span class="identifier">nanoseconds</span></code>.
- All of these units of time duration are united with a generic interface by
- the <a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ include <a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a>, <a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a> and <a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a>. All of these units
+ of time duration are united with a generic interface by the <a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> facility.
</li>
<li>
@@ -109,7 +99,7 @@
<div class="itemizedlist"><ul type="disc">
<li>
<a href="reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is a facility which
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is a facility which
is useful in specifying the type of the result of functions and operators
which take a variety of types (e.g. "mixed mode" complex arithmetic).
</li>
@@ -191,15 +181,18 @@
</p>
<div class="itemizedlist"><ul type="disc">
<li>
- __process_real_CPU<span class="underline">clock</span>_, capturing
+<a href="reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="
+ Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>, capturing
real-CPU times.
</li>
<li>
- __process_user_CPU<span class="underline">clock</span>_, capturing
+<a href="reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="
+ Class process_user_cpu_clock"><code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a>, capturing
user-CPU times.
</li>
<li>
- __process_system_CPU<span class="underline">clock</span>_, capturing
+<a href="reference/other_clocks.html#boost_chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="
+ Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>, capturing
system-CPU times.
</li>
<li>
@@ -209,7 +202,7 @@
</ul></div>
<p>
To complete the clocks <span class="bold"><strong>Boost.Chrono</strong></span> provides,
- in platforms support them, thread clocks.
+ in platforms having the needed support, thread clocks.
</p>
<p>
Last, <span class="bold"><strong>Boost.Chrono</strong></span> include typeof registration
@@ -219,7 +212,7 @@
on C++03 compilers.
</p>
<a name="boost_chrono.overview.how_to_use_this_documentation"></a><h3>
-<a name="id4803946"></a>
+<a name="id4804262"></a>
<a href="overview.html#boost_chrono.overview.how_to_use_this_documentation">How to
Use This Documentation</a>
</h3>
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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -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="caveat.html" title=" Caveat emptor">
+<link rel="next" href="../users_guide.html" title=" Users'Guide">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
@@ -20,21 +20,16 @@
</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="caveat.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="../users_guide.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">
<a name="boost_chrono.overview.motivation"></a>Motivation
</h3></div></div></div>
-<div class="toc"><dl>
-<dt><span class="section"><a href="motivation.html#boost_chrono.overview.motivation.common_type">Common
- type</a></span></dt>
-<dt><span class="section">Ratio</span></dt>
-<dt><span class="section">Duration</span></dt>
-<dt><span class="section">Clocks</span></dt>
-<dt><span class="section">Time Point</span></dt>
-<dt><span class="section">Stopwatches</span></dt>
-</dl></div>
+<a name="boost_chrono.overview.motivation.time"></a><h4>
+<a name="id4758557"></a>
+ Time
+ </h4>
<p>
We all deal with time every day of our lives. We've intuitively known it
since birth. Thus we are all very familiar with it and believe it to be a
@@ -56,949 +51,137 @@
time enforced safety.
</p>
<p>
- In addition to the clocks provided by the standard proposal, <span class="bold"><strong>Boost.Chrono</strong></span>
- provides specific process clocks and a thread clock.
- </p>
-<p>
See N2661 - A Foundation to Sleep On which is
very informative and provides motivation for key design decisions for <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a>, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and <code class="computeroutput"><span class="identifier">chrono</span></code>.
This documentation contains a lot of extracts from this document.
</p>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.common_type"></a><a href="motivation.html#boost_chrono.overview.motivation.common_type" title="Common
- type">Common
- type</a>
-</h4></div></div></div>
-<p>
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> has been a recurring
- theme in many places for many years. We've previously known it as promote
- and examples of it are spread throughout boost. It has been reinvented
- independently several times, because it is so useful.
- </p>
-<p>
- Andrei Alexandrescu recently pointed us at a D library: std.traits - D
- Programming Language - Digital Mars, which became the motivation for this
- particular name, and the variadic nature of <a href="http://www.digitalmars.com/d/2.0/phobos/std_traits.html#CommonType" target="_top">this
- trait</a>.
- </p>
-<p>
- In a nutshell, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is a trait that takes
- 1 or more types, and returns a type which all of the types will convert
- to. The default definition demands this conversion be implicit. However
- the trait can be specialized for user-defined types which want to limit
- their inter-type conversions to explicit, and yet still want to interoperate
- with the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> facility.
- </p>
-<p>
- <span class="bold"><strong>Example:</strong></span>
- </p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">complex</span><span class="special"><</span><span class="identifier">U</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
-<span class="keyword">operator</span><span class="special">+(</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">complex</span><span class="special"><</span><span class="identifier">U</span><span class="special">>);</span>
-</pre>
-<p>
- In the above example, "mixed-mode" complex arithmetic is allowed.
- The return type is described by <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a>. For example the resulting
- type of adding a <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span></code> and <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code> might be a <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code>. Another choice for the author might
- be:
- </p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span>
-<span class="identifier">complex</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">+(</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">complex</span><span class="special"><</span><span class="identifier">U</span><span class="special">>);</span>
-</pre>
-<p>
- Here is how someone might produce a variadic comparison function:
- </p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="special">...</span><span class="identifier">T</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">...>::</span><span class="identifier">type</span>
-<span class="identifier">min</span><span class="special">(</span><span class="identifier">T</span><span class="special">...</span> <span class="identifier">t</span><span class="special">);</span>
-</pre>
-<p>
- This is a very useful and broadly applicable utility. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> facilities use it to
- make multi-precision arithmetic seamless and exact.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.ratio"></a>Ratio
-</h4></div></div></div>
-<p>
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is a general purpose utility
- inspired by Walter Brown allowing one to easily and safely compute rational
- values at compile time. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> class catches all errors
- (such as divide by zero and overflow) at compile time. It is used in the
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> classes to efficiently
- create units of time. It can also be used in other "quantity"
- libraries (both std-defined and user-defined), or anywhere there is a rational
- constant which is known at compile time. The use of this utility can greatly
- reduce the chances of run time overflow because the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> (and any ratios resulting
- from <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic) are always reduced
- to lowest terms.
- </p>
-<p>
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is a template taking two
- intmax_ts, with the second defaulted to 1. In addition to copy constructors
- and assignement, it only has two public members, both of which are static
- const intmax_t. One is the numerator of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and the other is the denominator.
- The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is always normalized such
- that it is expressed in lowest terms, and the denominator is always positive.
- When the numerator is 0, the denominator is always 1.
- </p>
-<p>
- <span class="bold"><strong>Example:</strong></span>
- </p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">5</span><span class="special">,</span> <span class="number">3</span><span class="special">></span> <span class="identifier">five_thirds</span><span class="special">;</span> <span class="comment">// five_thirds::num == 5, five_thirds::den == 3
-</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">25</span><span class="special">,</span> <span class="number">15</span><span class="special">></span> <span class="identifier">also_five_thirds</span><span class="special">;</span> <span class="comment">// also_five_thirds::num == 5, also_five_thirds::den == 3
-</span><span class="keyword">typedef</span> <span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">five_thirds</span><span class="special">,</span> <span class="identifier">also_five_thirds</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">one</span><span class="special">;</span> <span class="comment">// one::num == 1, one::den == 1
-</span></pre>
-<p>
- This facility also includes convenience typedefs for the SI prefixes <code class="computeroutput"><span class="identifier">atto</span></code> through <code class="computeroutput"><span class="identifier">exa</span></code>
- corresponding to their internationally recognized definitions (in terms
- of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>). This is a tremendous syntactic
- convenience. It will prevent errors in specifying constants as one no longer
- has to double count the number of zeros when trying to write million or
- billion.
- </p>
-<p>
- <span class="bold"><strong>Example:</strong></span>
- </p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">giga</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5giga</span><span class="special">;</span> <span class="comment">// _5giga::num == 5000000000, _5giga::den == 1
-</span><span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">nano</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5nano</span><span class="special">;</span> <span class="comment">// _5nano::num == 1, _5nano::den == 200000000
-</span></pre>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.duration"></a>Duration
-</h4></div></div></div>
-<p>
- The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is the heart of this
- library. The interface that the user will see in everyday use is nearly
- identical to that of Boost.DateTime time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> authored by Jeff Garland,
- both in syntax and in behavior. This has been a very popular boost library
- for 7 years. There is an enormous positive history with this interface.
- </p>
-<p>
- The library consists of six units of time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>:
- </p>
-<div class="itemizedlist"><ul type="disc">
-<li><code class="computeroutput"><span class="identifier">hours</span></code></li>
-<li><code class="computeroutput"><span class="identifier">minutes</span></code></li>
-<li><code class="computeroutput"><span class="identifier">seconds</span></code></li>
-<li><code class="computeroutput"><span class="identifier">milliseconds</span></code></li>
-<li><code class="computeroutput"><span class="identifier">microseconds</span></code></li>
-<li><code class="computeroutput"><span class="identifier">nanoseconds</span></code></li>
-</ul></div>
-<p>
- These units were chosen as a subset of the boost library because they are
- the most common units used when sleeping, waiting on a condition variable,
- or waiting to obtain the lock on a mutex. Each of these units is nothing
- but a thin wrapper around a signed integral count. That is, when you construct
- <code class="computeroutput"><span class="identifier">minutes</span><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>, all that
- happens is a <code class="computeroutput"><span class="number">3</span></code> is stored inside
- of minutes. When you construct <code class="computeroutput"><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>,
- all that happens is a <code class="computeroutput"><span class="number">3</span></code> is
- stored inside of microseconds.
- </p>
-<p>
- 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, <code class="computeroutput"><span class="identifier">microseconds</span></code>
- can always represent any value <code class="computeroutput"><span class="identifier">minutes</span></code>
- has.
- </p>
-<p>
- In Boost.DateTime, these units are united via inheritance. <span class="bold"><strong>Boost.Chrono</strong></span>
- instead unites these units through the class template <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. That is, in <span class="bold"><strong>Boost.Chrono</strong></span> all six of the above units are nothing
- but typedefs to different instantiations of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. 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
- generate any unit, any precision it needs. This is sometimes necessary
- when doing comparisons or arithmetic between <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> of differing precision,
- assuming one wants the comparison and arithmetic to be exactly correct.
- </p>
-<p>
- A secondary benefit is that by publishing the class template <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> interface, user code
- can very easily create <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> with any precision they
- desire. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> utility is used to specify
- the precision, so as long as the precision can be expressed by a rational
- constant with respect to seconds, this framework can exactly represent
- it (one third of a second is no problem, and neither is one third of a
- <code class="computeroutput"><span class="identifier">femto</span></code> second). All of this
- utility and flexibility comes at no cost just by making use of the no-run-time-overhead
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> facility.
- </p>
-<p>
- In Boost.DateTime, <code class="computeroutput"><span class="identifier">hours</span></code>
- does not have the same representation as <code class="computeroutput"><span class="identifier">nanoseconds</span></code>.
- The former is usually represented with a <code class="computeroutput"><span class="keyword">long</span></code>
- whereas a <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">long</span></code>
- 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.
- </p>
-<p>
- <span class="bold"><strong>Boost.Chrono</strong></span> continues, and generalizes
- that philosophy. Not only can one specify the precision of a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, 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. <code class="computeroutput"><span class="identifier">nanoseconds</span></code>
- needs 64 bits to cover that range. <code class="computeroutput"><span class="identifier">hours</span></code>
- needs only 23 bits to cover that range.
- </p>
-<a name="boost_chrono.overview.motivation.duration.so_what_exactly_is_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__and_how_do_i_use_one_"></a><h5>
-<a name="id4813237"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.duration.so_what_exactly_is_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__and_how_do_i_use_one_">So
- What Exactly is a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and How Do I Use One?</a>
- </h5>
-<p>
- A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> has a representation
- and a tick period (precision).
- </p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</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">=</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">duration</span><span class="special">;</span>
-</pre>
-<p>
- The representation is simply any arithmetic type, or an emulation of such
- a type. The representation stores a count of ticks. This count is the only
- data member stored in a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. If the representation
- is floating point, it can store fractions of a tick to the precision of
- the representation. The tick period is represented by a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and is encoded into the
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>'s type, instead of stored.
- The tick period only has an impact on the behavior of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> when a conversion between
- different <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>'s is attempted. The tick
- period is completely ignored when simply doing arithmetic among like <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>.
- </p>
-<p>
- <span class="bold"><strong>Example:</strong></span>
- </p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span>
-<span class="identifier">minutes</span> <span class="identifier">m1</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// m1 stores 3
-</span><span class="identifier">minutes</span> <span class="identifier">m2</span><span class="special">(</span><span class="number">2</span><span class="special">);</span> <span class="comment">// m2 stores 2
-</span><span class="identifier">minutes</span> <span class="identifier">m3</span> <span class="special">=</span> <span class="identifier">m1</span> <span class="special">+</span> <span class="identifier">m2</span><span class="special">;</span> <span class="comment">// m3 stores 5
-</span>
-<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span>
-<span class="identifier">microseconds</span> <span class="identifier">us1</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// us1 stores 3
-</span><span class="identifier">microseconds</span> <span class="identifier">us2</span><span class="special">(</span><span class="number">2</span><span class="special">);</span> <span class="comment">// us2 stores 2
-</span><span class="identifier">microseconds</span> <span class="identifier">us3</span> <span class="special">=</span> <span class="identifier">us1</span> <span class="special">+</span> <span class="identifier">us2</span><span class="special">;</span> <span class="comment">// us3 stores 5
-</span>
-<span class="identifier">microseconds</span> <span class="identifier">us4</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">// us4 stores 300000005
-</span></pre>
-<p>
- In the final line of code above, there is an implicit conversion from minutes
- to microseconds, resulting in a relatively large number of microseconds.
- </p>
-<p>
- If you need to access the tick count within a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, there is a member <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span></code>
- which simply returns the stored tick count.
- </p>
-<pre class="programlisting"><span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">tc</span> <span class="special">=</span> <span class="identifier">us4</span><span class="special">.</span><span class="identifier">count</span><span class="special">();</span> <span class="comment">// tc is 300000005
-</span></pre>
-<p>
- These <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> have very simple, very
- predictable, and very observable behavior. After all, this is really nothing
- but the time tested interface of Jeff's boost time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> library (unified with
- templates 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__code__phrase_role__identifier__minutes__phrase___code__instead_of__code__phrase_role__identifier__microseconds__phrase___code__"></a><h5>
-<a name="id4813952"></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__code__phrase_role__identifier__minutes__phrase___code__instead_of__code__phrase_role__identifier__microseconds__phrase___code__">What
- happens if I assign <code class="computeroutput"><span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span></code>
- to <code class="computeroutput"><span class="identifier">minutes</span></code> instead of
- <code class="computeroutput"><span class="identifier">microseconds</span></code>?</a>
- </h5>
-<pre class="programlisting"><span class="identifier">minutes</span> <span class="identifier">m4</span> <span class="special">=</span> <span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span><span class="special">;</span>
-</pre>
-<p>
- It won't compile. The rationale is that implicit truncation error should
- not be allowed to happen. If this were to compile, then <code class="computeroutput"><span class="identifier">m4</span></code>
- would hold <code class="computeroutput"><span class="number">5</span></code>, the same value
- as <code class="computeroutput"><span class="identifier">m3</span></code>. The value associated
- with <code class="computeroutput"><span class="identifier">us3</span></code> has been effectively
- 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="id4814121"></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>
-<p>
- There is a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> facility to explicitly
- ask for this behavior:
- </p>
-<pre class="programlisting"><span class="identifier">minutes</span> <span class="identifier">m4</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">minutes</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">// m4.count() == 5
-</span></pre>
-<p>
- In general, one can perform <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arithmetic at will. If
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> isn't used, and
- it compiles, the arithmetic is exact. Any place one wants to override this
- exact arithmetic behavior, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> can be used to explicitly
- specify that desire. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> has the same efficiency
- as the implicit conversion, and will even be exact as often as it can.
- </p>
-<a name="boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code_s__link___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="id4814295"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.duration.i_m_trafficking_in_floating_point___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code_s__link___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 <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>. I don't want to deal
- with writing <code class="computeroutput"><span class="identifier">duration_cast</span></code>
- all over the place. I'm content with the precision of my floating point
- representation</a>
- </h5>
-<p>
- Not a problem. When the destination of a conversion has floating point
- representation, all conversions are allowed to happen implicitly.
- </p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">dminutes</span><span class="special">;</span>
-<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="id4814468"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.duration.how_expensive_is_all_of_this_">How
- expensive is all of this?</a>
- </h5>
-<p>
- If you were writing these conversions by hand, you could not make it more
- efficient. The use of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> ensures that all conversion
- constants are simplified as much as possible at compile time. This usually
- results in the numerator or denominator of the conversion factor simplifying
- to <code class="computeroutput"><span class="number">1</span></code>, and being subsequently
- ignored in converting the run time values of the tick counts.
- </p>
-<a name="boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__parameter_"></a><h5>
-<a name="id4814525"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.duration.how_complicated_is_it_to_build_a_function_taking_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_duration___code__phrase_role__identifier__duration__phrase___code___link__parameter_">How
- complicated is it to build a function taking a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> parameter?</a>
- </h5>
-<p>
- There are several options open to the user:
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- If the author of the function wants to accept any <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, and is willing to
- work in floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>, he can simply use
- any floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> as the parameter:
- </li></ul></div>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span> <span class="comment">// accept floating point seconds
-</span><span class="special">{</span>
- <span class="comment">// d.count() == 3.e-6 when passed microseconds(3)
-</span><span class="special">}</span>
-
-<span class="identifier">f</span><span class="special">(</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
-</pre>
-<div class="itemizedlist"><ul type="disc"><li>
- If the author of the function wants to traffic only in integral <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>, and is content with
- handling nothing finer than say nanoseconds (just as an example), he
- can simply specify nanoseconds as the parameter:
- </li></ul></div>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">nanoseconds</span> <span class="identifier">d</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="comment">// d.count() == 3000 when passed microseconds(3)
-</span><span class="special">}</span>
-
-<span class="identifier">f</span><span class="special">(</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
-</pre>
-<p>
- In this design, if the client wants to pass in a floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, or a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> of finer precision than
- nanoseconds, then the client is responsible for choosing his own rounding
- mode in the conversion to nanoseconds.
- </p>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">s</span><span class="special">(</span><span class="number">1.</span><span class="special">/</span><span class="number">3</span><span class="special">);</span> <span class="comment">// 1/3 of a second
-</span><span class="identifier">f</span><span class="special">(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">>(</span><span class="identifier">s</span><span class="special">));</span> <span class="comment">// round towards zero in conversion to nanoseconds
-</span></pre>
-<p>
- In the example above, the client of f has chosen "round towards zero"
- as the desired rounding mode to nanoseconds. If the client has a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> that won't exactly convert
- to nanoseconds, and fails to choose how the conversion will take place,
- the compiler will refuse the call:
- </p>
-<pre class="programlisting"><span class="identifier">f</span><span class="special">(</span><span class="identifier">s</span><span class="special">);</span> <span class="comment">// does not compile
-</span></pre>
-<div class="itemizedlist"><ul type="disc"><li>
- If the author of the function wants to accept any <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, but wants to work
- with integral representations and wants to control the rounding mode
- internally, then he can template the function:
- </li></ul></div>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</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">></span>
-<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="comment">// convert d to nanoseconds, rounding up if it is not an exact conversion
-</span> <span class="identifier">nanoseconds</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ns</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">++</span><span class="identifier">ns</span><span class="special">;</span>
- <span class="comment">// ns.count() == 333333334 when passed 1/3 of a floating point second
-</span><span class="special">}</span>
-
-<span class="identifier">f</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">1.</span><span class="special">/</span><span class="number">3</span><span class="special">));</span>
-</pre>
-<div class="itemizedlist"><ul type="disc"><li>
- If the author in the example does not want to accept floating point based
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>, he can enforce that
- behavior like so:
- </li></ul></div>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
-<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="comment">// convert d to nanoseconds, rounding up if it is not an exact conversion
-</span> <span class="identifier">nanoseconds</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ns</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">++</span><span class="identifier">ns</span><span class="special">;</span>
- <span class="comment">// ns.count() == 333333334 when passed 333333333333 picoseconds
-</span><span class="special">}</span>
-
-<span class="identifier">f</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">pico</span><span class="special">>(</span><span class="number">333333333333</span><span class="special">));</span> <span class="comment">// About 1/3 of a second worth of picoseconds
-</span></pre>
-<p>
- Clients with floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> who want to use f will
- now have to convert to an integral <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> themselves before passing
- the result to f.
- </p>
-<p>
- In summary, the author of f has quite a bit of flexibility and control
- in the interface he wants to provide his clients with, and easy options
- for manipulating that <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> internal to his function.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.clocks"></a>Clocks
-</h4></div></div></div>
-<p>
- While <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> only have precision
- and representation to concern themselves, clocks and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> are intimately related
- and refer to one another. Because clocks are simpler to explain, we will
- do so first without fully explaining <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a>. Once clocks are introduced,
- it will be easier to then fill in what a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> is.
- </p>
-<p>
- A clock is a concept which bundles 3 things:
- </p>
-<div class="orderedlist"><ol type="1">
-<li>
- A concrete <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> type.
- </li>
-<li>
- A concrete <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> type.
- </li>
-<li>
- A function called now() which returns the concrete <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>.
- </li>
-</ol></div>
-<p>
- <span class="bold"><strong>Boost.Chrono</strong></span> provides the standard concrete
- clocks:
- </p>
-<div class="orderedlist"><ol type="1">
-<li>
- system_clock
- </li>
-<li>
- monotonic_clock
- </li>
-<li>
- high_precision_clock
- </li>
-</ol></div>
-<p>
- A given platform may not be able to supply all three of these clocks. The
- user is also able to easily create more clocks.
- </p>
-<p>
- Given a clock named Clock, it will have:
- </p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">Clock</span> <span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">typedef</span> <span class="identifier">an</span> <span class="identifier">arithmetic</span><span class="special">-</span><span class="identifier">like</span> <span class="identifier">type</span> <span class="identifier">rep</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">an</span> <span class="identifier">instantiation</span> <span class="identifier">of</span> <span class="identifier">ratio</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">period</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
- <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span> <span class="keyword">or</span> <span class="keyword">false</span><span class="special">;</span>
-
- <span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">();</span>
-<span class="special">};</span>
-</pre>
-<p>
- One can get the current time from Clock with:
- </p>
-<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">t1</span> <span class="special">=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
-</pre>
-<p>
- And one can get the time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> between two <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> associated with Clock
- with:
- </p>
-<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t1</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
-</pre>
-<p>
- And one can specify a past or future <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> with:
- </p>
-<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">t2</span> <span class="special">=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">d</span><span class="special">;</span>
-</pre>
-<p>
- Note how even if a particular clock becomes obsolete, the next clock in
- line will have the same API. There is no new learning curve to come up.
- The only source code changes will be simply changing the type of the clock.
- The same <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> framework continues
- to work as new clocks are introduced. And multiple clocks are safely and
- easily handled within the same program.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.time_point"></a>Time Point
-</h4></div></div></div>
-<p>
- A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents a point
- in time, as opposed to a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> of time. Another way
- of saying the same thing, is that a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents an epoch
- plus or minus a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. Examples of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> include:
- </p>
-<div class="itemizedlist"><ul type="disc">
-<li>
- 3 minutes after the computer booted.
- </li>
-<li>
- 03:14:07 UTC on Tuesday, January 19, 2038
- </li>
-<li>
- 20 milliseconds after I started that timer.
- </li>
-</ul></div>
-<p>
- 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 <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> are known to share
- the same epoch, they can be subtracted, yielding a valid <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, even if the definition
- of the epoch no longer has meaning.
- </p>
-<p>
- In <span class="bold"><strong>Boost.Chrono</strong></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) <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> to a clock, and in
- the case that they share a clock, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> to one another. <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> 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___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_time_point___code__phrase_role__identifier__time_point__phrase___code___link__and_how_do_i_use_one_"></a><h5>
-<a name="id4816529"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.time_point.so_what_exactly_is_a___link_linkend__boost_chrono_reference_cpp0x_chrono_chrono_hpp_time_point___code__phrase_role__identifier__time_point__phrase___code___link__and_how_do_i_use_one_">So
- What Exactly is a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> and How Do I Use One?</a>
- </h5>
-<p>
- A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> has a clock and a
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
- </p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">time_point</span><span class="special">;</span>
-</pre>
-<p>
- The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>'s clock is not stored.
- It is simply embedded into the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>'s type and serves two
- purposes:
- </p>
-<div class="orderedlist"><ol type="1">
-<li>
- Because <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> originating from
- different clocks have different types, the compiler can be instructed
- to fail if incompatible <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> are used in inappropriate
- ways.
- </li>
-<li>
- Given a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>, one often needs
- to compare that <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> to "now".
- This is very simple as long as the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> knows what clock
- it is defined with respect to.
- </li>
-</ol></div>
-<p>
- A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>'s <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is stored as the only
- data member of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>. Thus <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> and their corresponding
- <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> have exactly the same
- layout. But they have very different meanings. For example, it is one thing
- to say I want to sleep for 3 minutes. It is a completely different thing
- to say I want to sleep until 3 minutes past the time I started that timer
- (unless you just happened to start that timer now). Both meanings (and
- options for sleeping) have great practical value in common use cases for
- sleeping, waiting on a condition variable, and waiting for a mutex's lock.
- These same concepts and tools are found (for example) in Ada.
- </p>
-<p>
- A timer example:
- </p>
-<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span>
-<span class="special">{</span>
- <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">start</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">g</span><span class="special">();</span>
- <span class="identifier">h</span><span class="special">();</span>
- <span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">sec</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">;</span>
- <span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"f() took "</span> <span class="special"><<</span> <span class="identifier">sec</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" seconds\n"</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
-<p>
- Note that if one is using the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> between two clock <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> in a way where the
- precision of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> matters, it is good practice
- to convert the clock's native <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> to a known <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. This insulates the code
- from future changes which may be made to the clock's native precision in
- the future. For example monotonic_clock could easily be based on the clock
- speed of the cpu. When you upgrade to a faster machine, you do not want
- your code that assumed a certain tick period of this clock to start experiencing
- run time failures because your timing code has silently changed meaning.
- </p>
-<p>
- A delay loop example:
- </p>
-<pre class="programlisting"><span class="comment">// delay for at least 500 nanoseconds:
-</span><span class="keyword">auto</span> <span class="identifier">go</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">500</span><span class="special">);</span>
-<span class="keyword">while</span> <span class="special">(</span><span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special"><</span> <span class="identifier">go</span><span class="special">)</span>
- <span class="special">;</span>
-</pre>
-<p>
- The above code will delay as close as possible to half a microsecond, no
- matter what the precision of monotonic_clock is. The more precise <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
- Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a> becomes, the more
- accurate will be the delay to 500 nanoseconds.
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.overview.motivation.stopwatches"></a>Stopwatches
-</h4></div></div></div>
-<p>
- Knowing how long a program, a function or a specific block takes to execute
- is useful in both test and production environments. <span class="bold"><strong>Boost.Chrono</strong></span>
- introduces the <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
+<a name="boost_chrono.overview.motivation.wall_clock_versus_system_and_user_time"></a><h4>
+<a name="id4758673"></a>
+ <a href="motivation.html#boost_chrono.overview.motivation.wall_clock_versus_system_and_user_time">Wall
+ clock versus system and user time</a>
+ </h4>
+<p>
+ It is also helpful if such timing information is broken down into real (wall
+ clock) time, CPU time spent by the user, and CPU time spent by the operating
+ system servicing user requests.
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Chrono</strong></span> provides thin wrappers around
+ the operating system's process timer API. For POSIX-like systems, that's
+ the times() function, while for Windows, it's the GetProcessTimes() function.
+ </p>
+<a name="boost_chrono.overview.motivation.reporting_slapsed_time"></a><h4>
+<a name="id4758714"></a>
+ <a href="motivation.html#boost_chrono.overview.motivation.reporting_slapsed_time">Reporting
+ slapsed time</a>
+ </h4>
+<p>
+ Knowing how long a program, a function or a specific block takes to execute
+ is useful in both test and production environments. <span class="bold"><strong>Boost.Chrono</strong></span>
+ introduces the <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> concept which captures
- the mechanism to measure the elapsed time. A Stopwatch allows to start,
- stop, suspend and resume the measure of the eleapsed time. <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code>
- is the basic model of <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
+ the mechanism to measure the elapsed time. A Stopwatch allows to start, stop,
+ suspend and resume the measure of the eleapsed time. <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ is the basic model of <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> allowing to make a single
- measure.
- </p>
-<p>
- At the user level, the main use case of measuring the elapsed time is to
- report these measures on the display. <code class="computeroutput"><span class="identifier">stopwatch_reporter</span><span class="special"><></span></code> provides a run time reporting package
- that can be invoked in a single line of code to report the usage of a Clock.
- For example
- </p>
-<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-
- <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
-</span>
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
- <span class="identifier">f1</span><span class="special">(</span><span class="number">100000</span><span class="special">);</span>
- <span class="identifier">f1</span><span class="special">(</span><span class="number">200000</span><span class="special">);</span>
- <span class="identifier">f1</span><span class="special">(</span><span class="number">300000</span><span class="special">);</span>
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
-<p>
- Will produce the following output
- </p>
-<pre class="programlisting"><span class="number">0.006</span><span class="identifier">s</span>
-<span class="number">0.011</span><span class="identifier">s</span>
-<span class="number">0.017</span><span class="identifier">s</span>
-</pre>
-<a name="boost_chrono.overview.motivation.stopwatches.stopwatches_accumulation_and_statistics"></a><h5>
-<a name="id4817777"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.stopwatches.stopwatches_accumulation_and_statistics">Stopwatches
- accumulation and statistics</a>
- </h5>
-<p>
- The preceding stopwatch manage only with a measure. It is also interesting
- to have an statisitical view of these times, for example the sum, min,
- max and mean. <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code> associates an accumulator with
- a <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
- Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>, so we are able to retrieve
- any statistical feature Boost.Accumulator provides.
- </p>
-<p>
- For example
- </p>
-<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">static</span> <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">sw</span><span class="special">;</span>
- <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">sw</span><span class="special">);</span>
-
- <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
-</span>
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
- <span class="identifier">f1</span><span class="special">(</span><span class="number">100000</span><span class="special">);</span>
- <span class="identifier">f1</span><span class="special">(</span><span class="number">200000</span><span class="special">);</span>
- <span class="identifier">f1</span><span class="special">(</span><span class="number">300000</span><span class="special">);</span>
- <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
-<p>
- Will produce the following output
- </p>
-<pre class="programlisting"><span class="number">3</span> <span class="identifier">times</span><span class="special">,</span> <span class="identifier">sum</span><span class="special">=</span><span class="number">0.034</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">min</span><span class="special">=</span><span class="number">0.006</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">max</span><span class="special">=</span><span class="number">0.017</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">mean</span><span class="special">=</span><span class="number">0.011</span><span class="identifier">s</span>
-</pre>
-<a name="boost_chrono.overview.motivation.stopwatches.wall_clock_versus_system_and_user_time"></a><h5>
-<a name="id4818309"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.stopwatches.wall_clock_versus_system_and_user_time">Wall
- clock versus system and user time</a>
- </h5>
-<p>
- It is also helpful if such timing information is broken down into real
- (wall clock) time, CPU time spent by the user, and CPU time spent by the
- operating system servicing user requests.
- </p>
-<p>
- <span class="bold"><strong>Boost.Chrono</strong></span> provides 3 concrete process
- clocks:
- </p>
-<div class="orderedlist"><ol type="1">
-<li>
-<code class="computeroutput"><span class="identifier">process_real_CPU_clock</span></code>,
- </li>
-<li>
-<code class="computeroutput"><span class="identifier">process_user_CPU_clock</span></code>,
- </li>
-<li><code class="computeroutput"><span class="identifier">process_system_CPU_clock</span></code></li>
-</ol></div>
-<p>
- providing a thin wrappers around the operating system's process timer API.
- For POSIX-like systems, that's the times() function, while for Windows,
- it's the GetProcessTimes() function.
- </p>
-<p>
- These clocks capture the specific time unitarily. <span class="bold"><strong>Boost.Chrono</strong></span>
- provides also a clock <code class="computeroutput"><span class="identifier">process_cpu_clock</span></code>
- that captures the three times at once.
- </p>
-<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
-<span class="special">{</span>
- <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
- <span class="comment">// ...
-</span><span class="special">}</span>
-</pre>
-<p>
- Will produce the following output
- </p>
-<pre class="programlisting"><span class="identifier">real</span> <span class="number">0.034</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">cpu</span> <span class="number">0.031</span><span class="identifier">s</span> <span class="special">(</span><span class="number">93.0</span><span class="special">%),</span> <span class="identifier">user</span> <span class="number">0.031</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">system</span> <span class="number">0.000</span><span class="identifier">s</span>
-</pre>
-<p>
- As this is one of the expression more commonly use, the library provides
- a stopclock shortcut so the preceding can be writen as
- </p>
-<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
-<span class="special">{</span>
- <span class="identifier">stopclock</span><span class="special"><></span> <span class="identifier">_</span><span class="special">;</span>
- <span class="comment">// ...
-</span><span class="special">}</span>
-</pre>
-<a name="boost_chrono.overview.motivation.stopwatches.how_reliable_are_these_measures_"></a><h5>
-<a name="id4818696"></a>
- <a href="motivation.html#boost_chrono.overview.motivation.stopwatches.how_reliable_are_these_measures_">How
- reliable are these measures?</a>
- </h5>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- this section need to be reworked, the ideas are there, but ...
- </p></td></tr>
-</table></div>
+ measure.
+ </p>
<p>
- There are three context on which you can get unreliable measures:
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- Precission of your clock. If the precission of your clock is 10ms you
- can not be able to measure the time spent by blocks of code that takes
- the same order of magnitude. The library provides a hig_resolution_clock
- that gives you the higher resolution available on your platform. Respect
- to the precission, nothing to do except to take the clock with the highest
- resolution and measures blocks of code that will spent time having more
- than one order of magnitude the precission of the clock.
- </li></ul></div>
+ At the user level, the main use case of measuring the elapsed time is to
+ report these measures on the display. <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
+ Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><code class="computeroutput"><span class="special"><></span></code> provides a run time reporting package
+ that can be invoked in a single line of code to report the usage of a Clock.
+ </p>
+<a name="boost_chrono.overview.motivation.caveat_emptor"></a><h4>
+<a name="id4758838"></a>
+ Caveat emptor
+ </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.overview.motivation.how_reliable_are_these_measures_"></a><h4>
+<a name="id4758868"></a>
+ <a href="motivation.html#boost_chrono.overview.motivation.how_reliable_are_these_measures_">How
+ reliable are these measures?</a>
+ </h4>
+<p>
+ There are three context on which you can get unreliable measures:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ Precission of your clock. If the precission of your clock is 10ms you can
+ not be able to measure the time spent by blocks of code that takes the
+ same order of magnitude. The library provides a hig_resolution_clock that
+ gives you the higher resolution available on your platform. Respect to
+ the precission, nothing to do except to take the clock with the highest
+ resolution and measures blocks of code that will spent time having more
+ than one order of magnitude the precission of the clock.
+ </li></ul></div>
<p>
-
+
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="special">...</span>
- <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">high_resolution_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+ <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
</pre>
<p>
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- When your application is multithreaded, and you use a process clock,
- the time you get is the delay during which your block has been executed,
- in concurrency with the other threads of execution. If what you want
- is the time spent by this specific thread another clock is needed. The
- library provide a <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
- Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> that returns the
- time spent by the thread on platforms providing this kind of data. It
- can be used as follows
- </li></ul></div>
-<p>
-
-</p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">thread_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="special">...</span>
-<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
- <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-<span class="preprocessor">#else</span>
- <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-<span class="preprocessor">#endif</span>
-</pre>
-<p>
- </p>
-<div class="itemizedlist"><ul type="disc"><li>
- Nested stopclocks (usually nested function calls where each function
- contains a stopclock). When the nesting is deep enough, the cumulative
- overhead of all the stopclock functionality make the data unreliable
- except for the inner-most trace points. The question is, how much time
- is related to the application code we want to measure and how much to
- the fact we are meassuring and logging in inner blocks?
- </li></ul></div>
-<p>
- Some measures let us think that most of the time spent by the stopclock
- mechanism is associated to the logging part. There are two things we can
- do to make the difference :
- </p>
+ </p>
<div class="itemizedlist"><ul type="disc">
<li>
- Avoid expensive operations as logging while doing the measures. Note
- that reporting in itself is not too expensive as far as we don't need
- to flush the buffer. This can be achieved either using a stopclock accumulator,
- 'i.e. don't report until all the measures have been compiled and then
- report some statistics or using an asynchronous stream.
- </li>
+ When your application is multithreaded, and you use a process clock, the
+ time you get is the delay during which your block has been executed, in
+ concurrency with the other threads of execution. If what you want is the
+ time spent by this specific thread another clock is needed. The library
+ provide a <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> that returns the
+ time spent by the thread on platforms providing this kind of data.
+ </li>
<li>
- Introduce some cheap mechanism that allows us to make the difference
- between the application time and the intrinsec stopclock time. When the
- precission of the clock is enough, we can suspend the counting of the
- Clock while we are spending time reporting the measures, and resume it
- once the work is done. The library provide a Clock wrapper <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="
- Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a> that make
- the resulting clock suspendible. The stopwatch_reporter is able to detect
- if the CLock is Suspendible and then suspend/resume the clock while doing
- the report.
- </li>
+ Nested stopclocks (usually nested function calls where each function contains
+ a stopclock). When the nesting is deep enough, the cumulative overhead
+ of all the stopclock functionality make the data unreliable except for
+ the inner-most trace points. The question is, how much time is related
+ to the application code we want to measure and how much to the fact we
+ are meassuring and logging in inner blocks?
+ </li>
</ul></div>
-<pre class="programlisting"><span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
-</pre>
<p>
- See the performances section for more deep details.
- </p>
-</div>
+ Some measures let us think that most of the time spent by the stopclock mechanism
+ is associated to the logging part. There are two things we can do to make
+ the difference :
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Avoid expensive operations as logging while doing the measures. Note that
+ reporting in itself is not too expensive as far as we don't need to flush
+ the buffer. This can be achieved either using a <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a>, 'i.e. don't
+ report until all the measures have been compiled and then report some statistics
+ or using an asynchronous stream.
+ </li>
+<li>
+ Introduce some cheap mechanism that allows us to make the difference between
+ the application time and the intrinsec stopclock time. When the precission
+ of the clock is enough, we can suspend the counting of the Clock while
+ we are spending time reporting the measures, and resume it once the work
+ is done. The library provide a Clock wrapper <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="
+ Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a> that make the
+ resulting clock suspendible. The stopwatch_reporter is able to detect if
+ the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock" title="
+ Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a> is a <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_req" title="
+ SuspendibleClock requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a> and then suspend/resume
+ the clock while doing the report.
+ </li>
+</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
@@ -1010,7 +193,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="caveat.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="../users_guide.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/cpp0x.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -33,50 +33,52 @@
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp"> Header
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">common_type</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
<dd><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.macros">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.conf">
Configuration macros</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.pp">
+ Preprocessor info</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type">
- Class Template 'common_type<>'</a></span></dt>
+ Class Template <code class="computeroutput"><span class="identifier">common_type</span><span class="special"><></span></code></a></span></dt>
</dl></dd>
<dt><span class="section"> Header <boost/ratio.hpp>
</span></dt>
<dd><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.macros"> Configuration
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.conf"> Configuration
macros</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio"> Class
Template <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic">
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic</a></span></dt>
+ <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison">
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> comparison</a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs">
SI typedefs</a></span></dt>
</dl></dd>
<dt><span class="section"> Header <boost/chrono.hpp>
</span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp"> Header
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
<dd><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.macros">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf">
Configuration macros</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock">
<code class="computeroutput"><span class="identifier">Clock</span></code> Requirements</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits">
Time-related traits</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe">
+ <code class="computeroutput"><span class="identifier">common_type</span></code> specializations</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration">
Class template <code class="computeroutput"><span class="identifier">duration</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic">duration
- non-member arithmetic</a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons">duration
- comparaisons</a></span></dt>
+<dt><span class="section">duration
non-member arithmetic</span></dt>
+<dt><span class="section">duration
Non-Member comparaisons</span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast">
Non-Member function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point">
Class template <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic">time_point
- non-member arithmetic</a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons">time_point
- comparisons</a></span></dt>
+<dt><span class="section">time_point
non-member arithmetic</span></dt>
+<dt><span class="section">time_point
non-member comparisons</span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_cast">
+ Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs">
+ <code class="computeroutput"><span class="identifier">duration</span></code> typedefs</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock">
Class <code class="computeroutput"><span class="identifier">system_clock</span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC">
@@ -96,34 +98,37 @@
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">common_type</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
</h4></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.macros">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.conf">
Configuration macros</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.pp">
+ Preprocessor info</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type">
- Class Template 'common_type<>'</a></span></dt>
+ Class Template <code class="computeroutput"><span class="identifier">common_type</span><span class="special"><></span></code></a></span></dt>
</dl></div>
-<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_COMMON_TYPE_ARITY</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_COMMON_TYPE_USES_STATIC_ASSERT</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_COMMON_TYPE_USES_MPL_ASSERT</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_COMMON_TYPE_USES_ARRAY_ASSERT</span>
-
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_COMMON_TYPE_MUST_BE_A_COMPLETE_TYPE</span>
+<pre class="programlisting"><span class="comment">// configuration macros
+</span><span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.conf" title="
+ Configuration macros"><code class="computeroutput"><span class="identifier">BOOST_COMMON_TYPE_USES_STATIC_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.conf" title="
+ Configuration macros"><code class="computeroutput"><span class="identifier">BOOST_COMMON_TYPE_USES_MPL_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.conf" title="
+ Configuration macros"><code class="computeroutput"><span class="identifier">BOOST_COMMON_TYPE_USES_ARRAY_ASSERT</span></code></a>
+
+<span class="comment">// preprocessor info
+</span><span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.pp" title="
+ Preprocessor info"><code class="computeroutput"><span class="identifier">BOOST_COMMON_TYPE_ARITY</span></code></a>
<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="special">...</span><span class="identifier">T</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="special">...</span><span class="identifier">T</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special">;</span>
<span class="special">}</span>
</pre>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.common_type_hpp.macros"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.macros" title="
+<a name="boost_chrono.reference.cpp0x.common_type_hpp.conf"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.conf" title="
Configuration macros">
Configuration macros</a>
</h5></div></div></div>
<p>
- When BOOST_NO_VARIADIC_TEMPLATES is defined BOOST_COMMON_TYPE_ARITY gives
- the maximum number of template parameters for <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a>.
- </p>
-<p>
When BOOST_NO_STATIC_ASSERT is defined, the user can select the way static
assertions are reported. Define
</p>
@@ -158,23 +163,38 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.common_type_hpp.pp"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.pp" title="
+ Preprocessor info">
+ Preprocessor info</a>
+</h5></div></div></div>
+<p>
+ When BOOST_NO_VARIADIC_TEMPLATES is defined BOOST_COMMON_TYPE_ARITY gives
+ the maximum number of template parameters for <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.reference.cpp0x.common_type_hpp.common_type"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'">
- Class Template 'common_type<>'</a>
+ Class Template common_type<>">
+ Class Template <code class="computeroutput"><span class="identifier">common_type</span><span class="special"><></span></code></a>
</h5></div></div></div>
<p>
<a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is a facility which
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is a facility which
is useful in specifying the type of the result of functions and operators
which take a variety of types (e.g. "mixed mode" complex arithmetic).
</p>
<p>
- The nested typedef <code class="computeroutput"><span class="identifier">common_type</span><span class="special">::</span><span class="identifier">type</span></code>
- could be defined as follows:
+ The nested typedef <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>::type` could be
+ defined as follows:
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">common_type</span> <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">V</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">V</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
@@ -199,7 +219,7 @@
<p>
<span class="bold"><strong>Note:</strong></span> Such specializations are required
when only explicit conversions are desired among the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> arguments.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> arguments.
</p>
</div>
</div>
@@ -208,17 +228,15 @@
<a name="boost_chrono.reference.cpp0x.ratio_hpp"></a> Header <boost/ratio.hpp>
</h4></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.macros"> Configuration
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.conf"> Configuration
macros</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio"> Class
Template <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic">
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic</a></span></dt>
+ <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison">
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> comparison</a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs">
+ <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs">
SI typedefs</a></span></dt>
</dl></div>
<p>
@@ -232,59 +250,97 @@
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> will reduce to 127/5000
meters).
</p>
-<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_USES_STATIC_ASSERT</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_USES_MPL_ASSERT</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_USES_ARRAY_ASSERT</span>
-
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_ADD</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_ADD</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_SUB</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_MUL</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_DIV</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_RATIO_NUMERATOR_IS_OUT_OF_RANGE</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_RATIO_DIVIDE_BY_0</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_RATIO_DENOMINATOR_IS_OUT_OF_RANGE</span>
+<pre class="programlisting"><span class="comment">// configuration macros
+</span><span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.conf" title=" Configuration
+ macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_STATIC_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.conf" title=" Configuration
+ macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_MPL_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.conf" title=" Configuration
+ macros"><code class="computeroutput"><span class="identifier">BOOST_RATIO_USES_ARRAY_ASSERT</span></code></a>
<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span> <span class="special">=</span> <span class="number">1</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">ratio</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">N</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">D</span> <span class="special">=</span> <span class="number">1</span><span class="special">></span> <span class="keyword">class</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">;</span>
<span class="comment">// ratio arithmetic
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_add</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_subtract</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_multiply</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_divide</span><span class="special">;</span>
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic" title="
+ ratio arithmetic"><code class="computeroutput"><span class="identifier">ratio_add</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic" title="
+ ratio arithmetic"><code class="computeroutput"><span class="identifier">ratio_subtract</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic" title="
+ ratio arithmetic"><code class="computeroutput"><span class="identifier">ratio_multiply</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic" title="
+ ratio arithmetic"><code class="computeroutput"><span class="identifier">ratio_divide</span></code></a><span class="special">;</span>
<span class="comment">// ratio comparison
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_equal</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_not_equal</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_less</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_less_equal</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_greater_equal</span><span class="special">;</span>
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison"><code class="computeroutput"><span class="identifier">ratio_equal</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison"><code class="computeroutput"><span class="identifier">ratio_not_equal</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison"><code class="computeroutput"><span class="identifier">ratio_less</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison"><code class="computeroutput"><span class="identifier">ratio_less_equal</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison"><code class="computeroutput"><span class="identifier">ratio_greater</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
+ ratio comparison"><code class="computeroutput"><span class="identifier">ratio_greater_equal</span></code></a><span class="special">;</span>
<span class="comment">// convenience SI typedefs
-</span> <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">atto</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">femto</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">pico</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">nano</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">micro</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">milli</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">centi</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">deci</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">deca</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">hecto</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">kilo</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">mega</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">giga</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">tera</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">peta</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
+ SI typedefs"><code class="computeroutput"><span class="identifier">exa</span></code></a><span class="special">;</span>
<span class="special">}</span>
</pre>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.ratio_hpp.macros"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.macros" title=" Configuration
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.conf"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.conf" title=" Configuration
macros"> Configuration
macros</a>
</h5></div></div></div>
@@ -313,7 +369,6 @@
are defined as
</p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_ADD</span> <span class="string">"overflow in ratio add"</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_ADD</span> <span class="string">"overflow in ratio add"</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_SUB</span> <span class="string">"overflow in ratio sub"</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_MUL</span> <span class="string">"overflow in ratio mul"</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_RATIO_OVERFLOW_IN_DIV</span> <span class="string">"overflow in ratio div"</span>
@@ -339,26 +394,19 @@
<span class="keyword">public</span><span class="special">:</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">num</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">intmax_t</span> <span class="identifier">den</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">den</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">den</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
- <span class="identifier">ratio</span><span class="special">()</span> <span class="special">{}</span>
+ <span class="identifier">ratio</span><span class="special">()</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
<span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">_D2</span><span class="special">></span>
- <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>&,</span>
- <span class="keyword">typename</span> <span class="identifier">enable_if_c</span>
- <span class="special"><</span>
- <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">num</span> <span class="special">==</span> <span class="identifier">num</span> <span class="special">&&</span>
- <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">den</span> <span class="special">==</span> <span class="identifier">den</span>
- <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span> <span class="special">{}</span>
+ <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>&);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">_D2</span><span class="special">></span>
- <span class="keyword">typename</span> <span class="identifier">enable_if_c</span>
- <span class="special"><</span>
- <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">num</span> <span class="special">==</span> <span class="identifier">num</span> <span class="special">&&</span>
- <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>::</span><span class="identifier">den</span> <span class="special">==</span> <span class="identifier">den</span><span class="special">,</span>
- <span class="identifier">ratio</span><span class="special">&</span>
- <span class="special">>::</span><span class="identifier">type</span>
- <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>&)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">_N2</span><span class="special">,</span> <span class="identifier">_D2</span><span class="special">>&)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
<span class="special">};</span>
</pre>
<p>
@@ -391,15 +439,19 @@
</ul></div>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- denotes the normalized form of this ratio type. It should be used when
- the template parameters doesn't give a normalized form.
+ denotes the normalized form of this <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> type. It should be used
+ when the template parameters doesn't give a normalized form.
</p>
<p>
Two <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> classes <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">></span></code>
- and <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">></span></code>
- have the same normalized form if <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">>::</span><span class="identifier">type</span></code>
- is the same type as <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">>::</span><span class="identifier">type</span></code>
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> classes <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">></span></code>
+ and <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">></span></code>
+ have the same normalized form if <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N1</span><span class="special">,</span><span class="identifier">D1</span><span class="special">>::</span><span class="identifier">type</span></code> is the same type as <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span><span class="identifier">D2</span><span class="special">>::</span><span class="identifier">type</span></code>
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
@@ -408,7 +460,8 @@
and assignment</a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">D2</span><span class="special">></span>
- <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
+ <span class="identifier">ratio</span><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> Constructs a <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
@@ -420,7 +473,9 @@
has the same normalized form as <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="identifier">intmax_t</span> <span class="identifier">N2</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">D2</span><span class="special">></span>
- <span class="identifier">ratio</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">ratio</span><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">N2</span><span class="special">,</span> <span class="identifier">D2</span><span class="special">>&</span> <span class="identifier">r</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> Assigns a <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
@@ -440,8 +495,7 @@
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_arithmetic" title="
ratio arithmetic">
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic</a>
+ <code class="computeroutput"><span class="identifier">ratio</span></code> arithmetic</a>
</h5></div></div></div>
<p>
For each of the class templates in this clause, each template parameter
@@ -456,7 +510,8 @@
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">+</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">+</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_subtract</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
@@ -464,7 +519,8 @@
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">-</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span> <span class="special">-</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_multiply</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
@@ -472,7 +528,8 @@
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span><span class="special">,</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_divide</span> <span class="special">{</span>
<span class="keyword">typedef</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="identifier">type</span><span class="special">;</span>
@@ -480,15 +537,15 @@
</pre>
<p>
The nested typedef <code class="computeroutput"><span class="identifier">type</span></code>
- is a synonym for <code class="computeroutput"><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
+ is a synonym for <code class="computeroutput"><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">R1</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">den</span><span class="special">,</span> <span class="identifier">R2</span><span class="special">::</span><span class="identifier">num</span> <span class="special">*</span> <span class="identifier">R1</span><span class="special">::</span><span class="identifier">den</span><span class="special">>::</span><span class="identifier">type</span></code>.
</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_comparison" title="
ratio comparison">
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
- Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> comparison</a>
+ <code class="computeroutput"><span class="identifier">ratio</span></code> comparison</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">R2</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">ratio_equal</span>
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special"><</span><span class="keyword">bool</span><span class="special">,</span> <span class="special">[/</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">]</span> <span class="special">></span> <span class="special">{};</span>
@@ -520,36 +577,56 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ration_SI_typedefs" title="
+<a name="boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio_si_typedefs" title="
SI typedefs">
SI typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="comment">// convenience SI typedefs
-</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000000LL</span><span class="special">></span> <span class="identifier">atto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000000LL</span><span class="special">></span> <span class="identifier">femto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000000LL</span><span class="special">></span> <span class="identifier">pico</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000000LL</span><span class="special">></span> <span class="identifier">nano</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000000LL</span><span class="special">></span> <span class="identifier">micro</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">1000LL</span><span class="special">></span> <span class="identifier">milli</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">100LL</span><span class="special">></span> <span class="identifier">centi</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1LL</span><span class="special">,</span> <span class="number">10LL</span><span class="special">></span> <span class="identifier">deci</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">10LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">deca</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">100LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">hecto</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">kilo</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">mega</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">giga</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">tera</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">peta</span><span class="special">;</span>
+<span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1000000000000000000LL</span><span class="special">,</span> <span class="number">1LL</span><span class="special">></span> <span class="identifier">exa</span><span class="special">;</span>
</pre>
<p>
Four of the typedefs in the recomendation which can be conditionally
supported are not supported: yocto, zepto, zetta and yotta.
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">1000000000000000000000000</span><span class="special">></span> <span class="identifier">yocto</span><span class="special">;</span> <span class="comment">// conditionally supported
-</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">1000000000000000000000</span><span class="special">></span> <span class="identifier">zepto</span><span class="special">;</span> <span class="comment">// conditionally supported
-</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">1000000000000000000000</span><span class="special">,</span> <span class="number">1</span><span class="special">></span> <span class="identifier">zetta</span><span class="special">;</span> <span class="comment">// conditionally supported
-</span><span class="keyword">typedef</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1000000000000000000000000</span><span class="special">,</span> <span class="number">1</span><span class="special">></span> <span class="identifier">yotta</span><span class="special">;</span> <span class="comment">// conditionally supported
+<pre class="programlisting"><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">1000000000000000000000000</span><span class="special">></span> <span class="identifier">yocto</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">1000000000000000000000</span><span class="special">></span> <span class="identifier">zepto</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">1000000000000000000000</span><span class="special">,</span> <span class="number">1</span><span class="special">></span> <span class="identifier">zetta</span><span class="special">;</span> <span class="comment">// conditionally supported
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1000000000000000000000000</span><span class="special">,</span> <span class="number">1</span><span class="special">></span> <span class="identifier">yotta</span><span class="special">;</span> <span class="comment">// conditionally supported
</span></pre>
</div>
</div>
@@ -574,26 +651,28 @@
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
</h4></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.macros">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf">
Configuration macros</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock">
<code class="computeroutput"><span class="identifier">Clock</span></code> Requirements</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits">
Time-related traits</a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe">
+ <code class="computeroutput"><span class="identifier">common_type</span></code> specializations</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration">
Class template <code class="computeroutput"><span class="identifier">duration</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic">duration
- non-member arithmetic</a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons">duration
- comparaisons</a></span></dt>
+<dt><span class="section">duration
non-member arithmetic</span></dt>
+<dt><span class="section">duration
Non-Member comparaisons</span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast">
Non-Member function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point">
Class template <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><></span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic">time_point
- non-member arithmetic</a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons">time_point
- comparisons</a></span></dt>
+<dt><span class="section">time_point
non-member arithmetic</span></dt>
+<dt><span class="section">time_point
non-member comparisons</span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_cast">
+ Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs">
+ <code class="computeroutput"><span class="identifier">duration</span></code> typedefs</a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock">
Class <code class="computeroutput"><span class="identifier">system_clock</span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC">
@@ -603,148 +682,248 @@
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock">
Class <code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a></span></dt>
</dl></div>
-<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
-
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION</span> <span class="special">\</span>
- <span class="string">"A duration representation can not be a duration"</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO</span> <span class="special">\</span>
- <span class="string">"Second template parameter of duration must be a std::ratio"</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE</span> <span class="special">\</span>
- <span class="string">"duration period must be positive"</span>
-<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_TIME_POINT_MUST_BE_A_BOOST_CHRONO_DURATION</span> <span class="special">\</span>
+<pre class="programlisting"><span class="comment">// configuration macros
+</span><span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf" title="
+ Configuration macros"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_STATIC_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf" title="
+ Configuration macros"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_MPL_ASSERT</span></code></a>
+<span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf" title="
+ Configuration macros"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_ARRAY_ASSERT</span></code></a>
+
+<span class="comment">// preprocessor info
+</span><span class="preprocessor">#define</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
- <span class="keyword">template</span> <span class="special"><</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">=</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">duration</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</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">=</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="keyword">class</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span> <span class="keyword">class</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">;</span>
<span class="special">}</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span>
- <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>;</span>
+ <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe" title="
+ common_type specializations"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>;</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span>
- <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">>;</span>
+ <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe" title="
+ common_type specializations"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">>;</span>
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
<span class="comment">// customization traits
-</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">treat_as_floating_point</span><span class="special">;</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">duration_values</span><span class="special">;</span>
+</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.treat_as_floating_point" title="
+ Metafunction treat_as_floating_point<>"><code class="computeroutput"><span class="identifier">treat_as_floating_point</span></code></a><span class="special">;</span>
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special">;</span>
<span class="comment">// duration arithmetic
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
- <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
- <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
- <span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
- <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
- <span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
- <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
- <span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
- <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
- <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
- <span class="keyword">double</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">double</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
<span class="comment">// duration comparisons
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="comment">// duration_cast
</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</span><span class="special">,</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">></span>
- <span class="identifier">ToDuration</span> <span class="identifier">duration_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">ToDuration</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
<span class="comment">// convenience typedefs
-</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <span class="identifier">nanoseconds</span><span class="special">;</span> <span class="comment">// at least 64 bits needed
-</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span> <span class="comment">// at least 55 bits needed
-</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">milliseconds</span><span class="special">;</span> <span class="comment">// at least 45 bits needed
-</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span> <span class="comment">// at least 35 bits needed
-</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span> <span class="comment">// at least 29 bits needed
-</span> <span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">hours</span><span class="special">;</span> <span class="comment">// at least 23 bits needed
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a><span class="special">;</span> <span class="comment">// at least 64 bits needed
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">;</span> <span class="comment">// at least 55 bits needed
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a><span class="special">;</span> <span class="comment">// at least 45 bits needed
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">;</span> <span class="comment">// at least 35 bits needed
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">60</span><span class="special">></span> <span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a><span class="special">;</span> <span class="comment">// at least 29 bits needed
+</span> <span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">hours</span></code></a><span class="special">;</span> <span class="comment">// at least 23 bits needed
</span>
<span class="comment">// time_point arithmetic
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
- <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
- <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
- <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+ <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
- <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
+ <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="comment">// time_point comparisons
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
+ <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span>
<span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
<span class="comment">// time_point_cast
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
- <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <span class="identifier">time_point_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_cast" title="
+ Non-Member function time_point_cast(time_point)"><code class="computeroutput"><span class="identifier">time_point_cast</span></code></a><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
<span class="comment">// Clocks
-</span> <span class="keyword">class</span> <span class="identifier">system_clock</span><span class="special">;</span>
- <span class="keyword">class</span> <span class="identifier">monotonic_clock</span><span class="special">;</span>
- <span class="keyword">class</span> <span class="identifier">high_resolution_clock</span><span class="special">;</span>
+</span> <span class="keyword">class</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.system_clock" title="
+ Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">;</span>
+ <span class="keyword">class</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a><span class="special">;</span>
+ <span class="keyword">class</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.high_resolution_clock" title="
+ Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
</pre>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.macros"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.macros" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.conf" title="
Configuration macros">
Configuration macros</a>
</h5></div></div></div>
@@ -991,7 +1170,6 @@
Metafunction <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values">
Class template <code class="computeroutput"><span class="identifier">duration_values</span></code></a></span></dt>
-<dt><span class="section">common_type
specializations</span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
@@ -1060,8 +1238,9 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> representation (<code class="computeroutput"><span class="identifier">Rep</span></code>). This is done because the representation
might be a class type with behavior which requires some other implementation
to return these special values. In that case, the author of that class
- type should specialize <code class="computeroutput"><span class="identifier">duration_values</span></code>
- to return the indicated values.
+ type should specialize <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a> to return
+ the indicated values.
</p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
@@ -1115,59 +1294,67 @@
</p>
</div>
</div>
+</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits._common_type__specializations"></a>common_type
specializations
-</h6></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.common_type_spe" title="
+ common_type specializations">
+ <code class="computeroutput"><span class="identifier">common_type</span></code> specializations</a>
+</h5></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
- The period of the <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> indicated by this
- specialization of <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is the greatest
- common divisor of <code class="computeroutput"><span class="identifier">Period1</span></code>
- and <code class="computeroutput"><span class="identifier">Period2</span></code>. This can
- be computed by forming a <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ The period of the <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> indicated by this specialization
+ of <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is the greatest
+ common divisor of <code class="computeroutput"><span class="identifier">Period1</span></code>
+ and <code class="computeroutput"><span class="identifier">Period2</span></code>. This can
+ be computed by forming a <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> of the greatest common
- divisor of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">num</span></code>
- and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">num</span></code>, and the least common multiple
- of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">den</span></code> and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">den</span></code>.
- </p>
+ divisor of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">num</span></code> and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">num</span></code>,
+ and the least common multiple of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">den</span></code>
+ and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">den</span></code>.
+ </p>
<p>
- <span class="bold"><strong>Note:</strong></span> The typedef type is the <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> with the largest
- tick period possible where both <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ <span class="bold"><strong>Note:</strong></span> The typedef type is the <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> with the largest tick
+ period possible where both <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments will convert
- to it without requiring a division operation. The representation of
- this type is intended to be able to hold any value resulting from this
- conversion, with the possible exception of round-off error when floating
- point <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ to it without requiring a division operation. The representation of this
+ type is intended to be able to hold any value resulting from this conversion,
+ with the possible exception of round-off error when floating point <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> are involved (but
- not truncation error).
- </p>
+ not truncation error).
+ </p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">struct</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
<span class="special">};</span>
</pre>
<p>
- The <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ The <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> is a <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
- Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> with the same
- <code class="computeroutput"><span class="identifier">clock</span></code> (both have the
- same <code class="computeroutput"><span class="identifier">clock</span></code>), and the
- <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> with the same <code class="computeroutput"><span class="identifier">clock</span></code> (both have the same <code class="computeroutput"><span class="identifier">clock</span></code>), and the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>.
- </p>
-</div>
+ </p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
@@ -1235,23 +1422,10 @@
</span> <span class="keyword">public</span><span class="special">:</span>
<span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">()</span> <span class="special">{}</span> <span class="comment">// = default;
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
- <span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">r</span><span class="special">,</span>
- <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if_c</span>
- <span class="special"><</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
- <span class="special">&&</span> <span class="special">(</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
- <span class="special">||</span> <span class="special">(!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
- <span class="special">&&</span> <span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">))</span>
- <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+ <span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">r</span><span class="special">);</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
- <span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span>
- <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if_c</span>
- <span class="special"><</span>
- <span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
- <span class="special">||</span> <span class="special">(</span><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period2</span><span class="special">,</span> <span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span><span class="special">::</span><span class="identifier">den</span> <span class="special">==</span> <span class="number">1</span>
- <span class="special">&&</span> <span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">value</span><span class="special">)</span>
- <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+ <span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
<span class="comment">//~duration() = default;
</span> <span class="comment">//duration(const duration&) = default;
@@ -1305,15 +1479,20 @@
</p>
<div class="itemizedlist"><ul type="disc">
<li>
-<code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span></code> holds a count of minutes using
+<code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span></code> holds a count of minutes using
a long.
</li>
<li>
-<code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span></code> holds a count of milliseconds using
+<code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span></code> holds a count of milliseconds using
a long long.
</li>
<li>
-<code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">30</span><span class="special">></span> <span class="special">></span></code>
+<code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">30</span><span class="special">></span> <span class="special">></span></code>
holds a count using a double with a tick period of 1/30 second (a tick
frequency of 30 Hz).
</li>
@@ -1359,8 +1538,10 @@
<p>
<span class="bold"><strong>Example:</strong></span>
</p>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3.5</span><span class="special">);</span> <span class="comment">// do not compile
-</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// ok
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3.5</span><span class="special">);</span> <span class="comment">// do not compile
+</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// ok
</span></pre>
<p>
<span class="bold"><strong>Effects:</strong></span> Constructs an object of type
@@ -1378,7 +1559,9 @@
Constructor <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+<span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Remarks:</strong></span> <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span></code>,
@@ -1395,14 +1578,18 @@
<p>
<span class="bold"><strong>Example:</strong></span>
</p>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
-<span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">ms</span><span class="special">;</span> <span class="comment">// ok
-</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms2</span> <span class="special">=</span> <span class="identifier">us</span><span class="special">;</span> <span class="comment">// do not compile
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">ms</span><span class="special">;</span> <span class="comment">// ok
+</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms2</span> <span class="special">=</span> <span class="identifier">us</span><span class="special">;</span> <span class="comment">// do not compile
</span></pre>
<p>
<span class="bold"><strong>Effects:</strong></span> Constructs an object of type
<a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
- Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, constructing <code class="computeroutput"><span class="identifier">rep_</span></code> from <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">duration</span><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, constructing <code class="computeroutput"><span class="identifier">rep_</span></code> from <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
</p>
</div>
<div class="section" lang="en">
@@ -1423,7 +1610,8 @@
Member function operator+() const">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span><span class="special">;</span>
+<pre class="programlisting"><span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
@@ -1435,10 +1623,12 @@
Member function operator+() const">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span><span class="special">;</span>
+<pre class="programlisting"><span class="identifier">BOOST_CHRONO_CONSTEXPR</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(-</span><span class="identifier">rep_</span><span class="special">)</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(-</span><span class="identifier">rep_</span><span class="special">)</span></code>.
</p>
</div>
<div class="section" lang="en">
@@ -1447,7 +1637,8 @@
Member function operator++()">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">++();</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">++();</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">++</span><span class="identifier">rep_</span></code>.
@@ -1462,10 +1653,12 @@
Member function operator++(int)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">);</span>
</pre>
<p>
- <span class="bold"><strong>Returns:</strong></span> `duration(rep_++)v.
+ <span class="bold"><strong>Returns:</strong></span> ` <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>(rep_++)v.
</p>
</div>
<div class="section" lang="en">
@@ -1474,7 +1667,8 @@
Member function operator++()">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">--();</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">--();</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">--</span><span class="identifier">rep_</span></code>.
@@ -1489,10 +1683,12 @@
Member function operator++(int)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">);</span>
</pre>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">--)</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="identifier">rep_</span><span class="special">--)</span></code>.
</p>
</div>
<div class="section" lang="en">
@@ -1501,7 +1697,9 @@
Member function operator+=(const duration&)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
@@ -1517,7 +1715,9 @@
Member function operator-=(const duration&)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
@@ -1533,7 +1733,9 @@
Member function operator%=(const duration&)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
@@ -1549,7 +1751,8 @@
Member function operator*=(const rep&)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
@@ -1565,7 +1768,8 @@
Member function operator/=(const rep&)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
@@ -1581,7 +1785,8 @@
Member function operator%=(const rep&)">
Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<pre class="programlisting"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
@@ -1597,10 +1802,13 @@
Static Member function zero()">
Static Member function <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">duration</span> <span class="identifier">zero</span><span class="special">();</span>
+<pre class="programlisting"><span class="keyword">static</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="identifier">zero</span><span class="special">();</span>
</pre>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">zero</span><span class="special">())</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">zero</span><span class="special">())</span></code>.
</p>
</div>
<div class="section" lang="en">
@@ -1609,10 +1817,13 @@
Static Member function min()">
Static Member function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">duration</span> <span class="identifier">min</span><span class="special">();</span>
+<pre class="programlisting"><span class="keyword">static</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="identifier">min</span><span class="special">();</span>
</pre>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">min</span><span class="special">()).</span></code>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">min</span><span class="special">()).</span></code>
</p>
</div>
<div class="section" lang="en">
@@ -1621,46 +1832,52 @@
Static Member function max()">
Static Member function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">constexpr</span> <span class="identifier">duration</span> <span class="identifier">max</span><span class="special">();</span>
+<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">constexpr</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="identifier">max</span><span class="special">();</span>
</pre>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">max</span><span class="special">())</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">max</span><span class="special">())</span></code>.
</p>
</div>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic" title="duration
- non-member arithmetic">duration
- non-member arithmetic</a>
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic"></a>duration
non-member arithmetic
</h5></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_p_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_p_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_m_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_m_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_prod_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_prod_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_2">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_2">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_3">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_3">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_mod_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_mod_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_mod_2">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_mod_2">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_p_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_p_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_p_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_p_1" title="
Non-Member function operator+(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
-<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">rhs</span></code> where <code class="computeroutput"><span class="identifier">CD</span></code>
@@ -1669,48 +1886,60 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_m_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_m_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_m_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_m_1" title="
Non-Member function operator-(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
-<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">)</span> <span class="special">-=</span> <span class="identifier">rhs</span></code> where <code class="computeroutput"><span class="identifier">CD</span></code>
is the type of the return value.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
-<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
This function will not participate in overload resolution unless both
<code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly convertible to
<code class="computeroutput"><span class="identifier">CR</span></code>.
</p>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="identifier">CR</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>(</span><span class="identifier">d</span><span class="special">)</span> <span class="special">*=</span> <span class="identifier">s</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">CR</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>(</span><span class="identifier">d</span><span class="special">)</span> <span class="special">*=</span> <span class="identifier">s</span></code>.
</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_prod_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_prod_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_prod_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_prod_1" title="
Non-Member function operator*(Rep1,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
-<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
This function will not participate in overload resolution unless both
<code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly convertible to
<code class="computeroutput"><span class="identifier">CR</span></code>.
@@ -1722,18 +1951,21 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_1" title="
Non-Member function operator/(duration,Rep2)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
-<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
This function will not participate in overload resolution unless both
<code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly convertible to
<code class="computeroutput"><span class="identifier">CR</span></code>, and <code class="computeroutput"><span class="identifier">Rep2</span></code> is not an instantiation of
@@ -1741,23 +1973,27 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
</p>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="identifier">CR</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>(</span><span class="identifier">d</span><span class="special">)</span> <span class="special">/=</span> <span class="identifier">s</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">CR</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>(</span><span class="identifier">d</span><span class="special">)</span> <span class="special">/=</span> <span class="identifier">s</span></code>.
</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_2" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_2" title="
Non-Member function operator/(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
-<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments. Returns
<code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special">/</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
@@ -1765,17 +2001,18 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_3"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_d_3" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_3"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_d_3" title="
Non-Member function operator/(Rep1,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
-<span class="keyword">double</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+<span class="keyword">double</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Remarks:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>.
This function will not participate in overload resolution unless both
<code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly convertible to
<code class="computeroutput"><span class="identifier">CR</span></code>, and <code class="computeroutput"><span class="identifier">Rep1</span></code> is not an instantiation of
@@ -1783,38 +2020,49 @@
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
</p>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CR</span><span class="special">(</span><span class="identifier">s</span><span class="special">)/</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">CR</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>(</span><span class="identifier">d</span><span class="special">)</span></code>.
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CR</span><span class="special">(</span><span class="identifier">s</span><span class="special">)/</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">CR</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>(</span><span class="identifier">d</span><span class="special">)</span></code>.
</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_mod_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_mod_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_mod_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_mod_1" title="
Non-Member function operator%(duration,Rep2)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
-<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Remarks</strong></span> This function will not participate
in overload resolution unless Rep2 must be implicitly convertible to
- CR(Rep1, Rep2) and Rep2 must not be an instantiation of duration.
+ CR(Rep1, Rep2) and Rep2 must not be an instantiation of <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
</p>
<p>
- <span class="bold"><strong>Returns:</strong></span> duration<CR(Rep1,Rep2),
+ <span class="bold"><strong>Returns:</strong></span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><CR(Rep1,Rep2),
Period>(d) %= s.
</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_mod_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_non_member_arithmetic.duration_operator_mod_2" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_mod_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_arithmetic.duration_operator_mod_2" title="
Non-Member function operator%(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
-<span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Remarks</strong></span> This function will not participate
@@ -1827,37 +2075,37 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons" title="duration
- comparaisons">duration
- comparaisons</a>
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons"></a>duration
Non-Member comparaisons
</h5></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_eq_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_eq_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_neq_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_neq_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_lt_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_lt_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_leq_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_leq_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_gt_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_gt_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_gteq_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_gteq_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_eq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_eq_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_eq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_eq_1" title="
Non-Member function operator==(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments. Returns
<code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special">==</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>
@@ -1865,12 +2113,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_neq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_neq_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_neq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_neq_1" title="
Non-Member function operator!=(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special">==</span>
@@ -1879,17 +2129,19 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_lt_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_lt_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_lt_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_lt_1" title="
Non-Member function operator<(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
represent the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of the two <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments. Returns
<code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special"><</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>
@@ -1897,12 +2149,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_leq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_leq_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_leq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_leq_1" title="
Non-Member function operator<=(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">rhs</span> <span class="special"><</span>
@@ -1911,12 +2165,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_gt_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_gt_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_gt_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_gt_1" title="
Non-Member function operator>(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
@@ -1925,12 +2181,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_gteq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_comparaisons.duration_operator_gteq_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_gteq_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._duration__non_member_comparaisons.duration_operator_gteq_1" title="
Non-Member function operator>=(duration,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special"><</span>
@@ -1945,7 +2203,8 @@
Non-Member function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</span><span class="special">,</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">></span>
-<span class="identifier">ToDuration</span> <span class="identifier">duration_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
+<span class="identifier">ToDuration</span> <span class="identifier">duration_cast</span><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requires:</strong></span> This function will not participate
@@ -1958,7 +2217,7 @@
which is a <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> resulting from <code class="computeroutput"><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span></code>.
Let <code class="computeroutput"><span class="identifier">CR</span></code> be the <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span></code>, <code class="computeroutput"><span class="identifier">Rep</span></code>,
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> of <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span></code>, <code class="computeroutput"><span class="identifier">Rep</span></code>,
and <code class="computeroutput"><span class="identifier">intmax_t</span></code>.
</p>
<div class="itemizedlist"><ul type="disc">
@@ -2043,11 +2302,8 @@
<span class="comment">// conversions
</span> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
- <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">,</span>
- <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if</span>
- <span class="special"><</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_convertible</span><span class="special"><</span><span class="identifier">Duration2</span><span class="special">,</span> <span class="identifier">duration</span><span class="special">></span>
- <span class="special">>::</span><span class="identifier">type</span><span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
+ <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
<span class="comment">// observer
</span>
@@ -2114,7 +2370,8 @@
Constructor time_point(const duration&)">
Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
</h6></div></div></div>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Requires:</strong></span> This function will not participate
@@ -2200,29 +2457,30 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic" title="time_point
- non-member arithmetic">time_point
- non-member arithmetic</a>
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic"></a>time_point
non-member arithmetic
</h5></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_p_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_2">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_p_2">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_1">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_m_1">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_2">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_m_2">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_p_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_p_1" title="
Non-Member function operator+(time_point,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CT</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">)</span> <span class="special">+=</span> <span class="identifier">rhs</span></code> where <code class="computeroutput"><span class="identifier">CT</span></code>
@@ -2231,13 +2489,16 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_p_2" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_p_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_p_2" title="
Non-Member function operator+(duration,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
@@ -2246,13 +2507,16 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_1" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_m_1"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_m_1" title="
Non-Member function operator-(time_point,duration)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
-<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
-<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span>
@@ -2261,13 +2525,16 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_non_member_arithmetic.time_point_operator_m_2" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_m_2"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_arithmetic.time_point_operator_m_2" title="
Non-Member function operator-(duration,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
-<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">typename</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
@@ -2276,34 +2543,32 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons" title="time_point
- comparisons">time_point
- comparisons</a>
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons"></a>time_point
non-member comparisons
</h5></div></div></div>
<div class="toc"><dl>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_eq">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_eq">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_neq">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_neq">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_lt">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_lt">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_leq">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_leq">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_gt">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_gt">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_geq">
+<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_geq">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
-<dt><span class="section"><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_cast">
- Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_eq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_eq" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_eq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_eq" title="
Non-Member function operator==(time_point,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
@@ -2311,14 +2576,17 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_neq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_neq" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_neq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_neq" title="
Non-Member function operator!=(time_point,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<p>
template <class Clock, class Duration1, class Duration2> bool
- operator!=(const time_point<Clock, Duration1>& lhs, const
- time_point<Clock, Duration2>& rhs);
+ operator!=(const <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><Clock, Duration1>&
+ lhs, const <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><Clock, Duration2>&
+ rhs);
</p>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special">==</span>
@@ -2327,12 +2595,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_lt"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_lt" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_lt"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_lt" title="
Non-Member function operator<(time_point,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> lhs.time_since_epoch() <
@@ -2341,12 +2611,14 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_leq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_leq" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_leq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_leq" title="
Non-Member function operator<=(time_point,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">rhs</span> <span class="special"><</span>
@@ -2355,14 +2627,17 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_gt"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_gt" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_gt"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_gt" title="
Non-Member function operator>(time_point,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<p>
template <class Clock, class Duration1, class Duration2> bool
- operator> (const time_point<Clock, Duration1>& lhs, const
- time_point<Clock, Duration2>& rhs);
+ operator> (const <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><Clock, Duration1>&
+ lhs, const <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><Clock, Duration2>&
+ rhs);
</p>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
@@ -2371,37 +2646,65 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_geq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_operator_geq" title="
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_geq"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp._time_point__non_member_comparisons.time_point_operator_geq" title="
Non-Member function operator>=(time_point,time_point)">
Non-Member function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
+<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special"><</span>
<span class="identifier">rhs</span><span class="special">)</span></code>.
</p>
</div>
+</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h6 class="title">
-<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_cast"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_comparisons.time_point_cast" title="
- Non-Member function time_point_cast(time_point)">
- Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
-</h6></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_cast"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point_cast" title="
+ Non-Member function time_point_cast(time_point)">
+ Non-Member function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
+</h5></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
-<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <span class="identifier">time_point_cast</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
+ <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <span class="identifier">time_point_cast</span><span class="special">(</span><span class="keyword">const</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
</pre>
<p>
- <span class="bold"><strong>Requires:</strong></span> This function will not participate
- in overload resolution unless <code class="computeroutput"><span class="identifier">ToDuration</span></code>
- is an instantiation of <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ <span class="bold"><strong>Requires:</strong></span> This function will not participate
+ in overload resolution unless <code class="computeroutput"><span class="identifier">ToDuration</span></code>
+ is an instantiation of <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
- </p>
+ </p>
<p>
- <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()))</span></code>.
- </p>
+ <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()))</span></code>.
+ </p>
</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs"></a><a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs">
+ <code class="computeroutput"><span class="identifier">duration</span></code> typedefs</a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="comment">// convenience typedefs
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <span class="identifier">nanoseconds</span><span class="special">;</span> <span class="comment">// at least 64 bits needed
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span> <span class="comment">// at least 55 bits needed
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">milliseconds</span><span class="special">;</span> <span class="comment">// at least 45 bits needed
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span> <span class="comment">// at least 35 bits needed
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span> <span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span> <span class="comment">// at least 29 bits needed
+</span><span class="keyword">typedef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">hours</span><span class="special">;</span> <span class="comment">// at least 23 bits needed
+</span></pre>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
@@ -2430,7 +2733,8 @@
<span class="keyword">typedef</span> <span class="identifier">BOOST_SYSTEM_CLOCK_DURATION</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">system_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">();</span> <span class="comment">// throws on error
@@ -2518,7 +2822,8 @@
<span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">monotonic_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">monotonic_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">();</span> <span class="comment">// throws on error
@@ -2538,7 +2843,8 @@
satisfy the <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock" title="
Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code> requirements</a>.
</p>
-<pre class="programlisting"><span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<pre class="programlisting"><span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">monotonic_clock</span> <span class="identifier">high_resolution_clock</span><span class="special">;</span> <span class="comment">// as permitted by [time.clock.hires]
</span><span class="preprocessor">#else</span>
<span class="keyword">typedef</span> <span class="identifier">system_clock</span> <span class="identifier">high_resolution_clock</span><span class="special">;</span> <span class="comment">// as permitted by [time.clock.hires]
@@ -2553,8 +2859,9 @@
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
</h4></div></div></div>
<p>
- Register <code class="computeroutput"><span class="identifier">duration</span><span class="special"><></span></code>
- and <code class="computeroutput"><span class="identifier">timepoint</span><span class="special"><></span></code>
+ Register <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ and <span class="underline">_timepoint</span>_<code class="computeroutput"><span class="special"><></span></code>
class templates to Boost.Typeof.
</p>
</div>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/deprecated.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -66,7 +66,8 @@
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">high_resolution_clock</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">timer</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_timer</span><span class="special">;</span>
- <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">monotonic_timer</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_timer</span><span class="special">;</span>
@@ -114,7 +115,8 @@
<code class="computeroutput"><span class="identifier">timer</span></code> useful typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">timer</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_timer</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">timer</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_timer</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">timer</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_timer</span><span class="special">;</span>
@@ -179,7 +181,8 @@
<span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">struct</span> <span class="identifier">process_times</span><span class="special">;</span>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/formatters.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/formatters.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/formatters.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -310,7 +310,8 @@
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">t24_hours</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">24</span><span class="special">*</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">days</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">24</span><span class="special">*</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">days</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</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">boost</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">boost</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>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/other_clocks.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/other_clocks.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/other_clocks.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -128,7 +128,8 @@
<span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
@@ -158,7 +159,8 @@
<span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
@@ -189,7 +191,8 @@
<span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
@@ -230,14 +233,16 @@
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">times</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">struct</span> <span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">times</span><span class="special">>;</span>
+<span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">times</span><span class="special">>;</span>
</pre>
<div class="section" lang="en">
<div class="titlepage"><div><div><h6 class="title">
@@ -278,7 +283,8 @@
<code class="computeroutput"><span class="identifier">times</span></code></a>
</h6></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">struct</span> <span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">times</span><span class="special">></span>
+<span class="keyword">struct</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.traits.duration_values" title="
+ Class template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">times</span><span class="special">></span>
<span class="special">{</span>
<span class="keyword">static</span> <span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">times</span> <span class="identifier">zero</span><span class="special">();</span>
<span class="keyword">static</span> <span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">times</span> <span class="identifier">max</span><span class="special">();</span>
@@ -365,7 +371,8 @@
<span class="keyword">typedef</span> <span class="identifier">nanoseconds</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="identifier">BOOST_CHRONO_THREAD_CLOCK_IS_MONOTONIC</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
@@ -621,7 +628,8 @@
Given a <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock" title="
Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>, <a href="other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="
Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a> < <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.clock" title="
- Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>> is a model of <span class="underline">_SuspendibleClock</span>_.
+ Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>> is a model of <a href="other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_req" title="
+ SuspendibleClock requirements"><code class="computeroutput"><span class="identifier">SuspendibleClock</span></code></a>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span> <span class="special">></span>
<span class="keyword">class</span> <span class="identifier">suspendible_clock</span> <span class="special">{</span>
@@ -629,7 +637,8 @@
<span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">duration</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">throws</span> <span class="special">);</span>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/reporters.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -520,7 +520,8 @@
<span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Formatter</span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">wstopclock</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_stopclock</span><span class="special">;</span>
- <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">monotonic_stopclock</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_stopclock</span><span class="special">;</span>
@@ -529,7 +530,8 @@
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_system_cpu_stopclock</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_wstopclock</span><span class="special">;</span>
- <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">monotonic_wstopclock</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_wstopclock</span><span class="special">;</span>
@@ -645,7 +647,8 @@
<code class="computeroutput"><span class="identifier">stopclock</span></code> useful typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_stopwatch_stopclock</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_stopwatch_stopclock</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_stopclock</span><span class="special">;</span>
@@ -712,7 +715,8 @@
<code class="computeroutput"><span class="identifier">wstopclock</span></code> useful typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_stopwatch_wstopclock</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_stopwatch_wstopclock</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_wstopclock</span><span class="special">;</span>
@@ -751,7 +755,8 @@
<span class="keyword">class</span> <span class="identifier">wstopclock_accumulator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_stopclock_accumulator</span><span class="special">;</span>
- <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">monotonic_stopclock_accumulator</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_stopclock_accumulator</span><span class="special">;</span>
@@ -760,7 +765,8 @@
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">process_system_cpu_stopclock_accumulator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_wstopclock_accumulator</span><span class="special">;</span>
- <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">monotonic_wstopclock_accumulator</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_wstopclock_accumulator</span><span class="special">;</span>
@@ -884,7 +890,8 @@
typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_stopclock_accumulator</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_stopclock_accumulator</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_stopclock_accumulator</span><span class="special">;</span>
@@ -955,7 +962,8 @@
useful typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_wstopclock_accumulator</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_wstopclock_accumulator</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">wstopclock_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_wstopclock_accumulator</span><span class="special">;</span>
@@ -1010,7 +1018,7 @@
<span class="special">}</span>
</pre>
<a name="boost_chrono.reference.reporters.scoped_stopclock_hpp.scoped_stopclock.synopsis"></a><h6>
-<a name="id4924967"></a>
+<a name="id4929292"></a>
<a href="reporters.html#boost_chrono.reference.reporters.scoped_stopclock_hpp.scoped_stopclock.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">=</span><span class="identifier">process_cpu_clock</span>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/reference/stopwatches.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -51,8 +51,7 @@
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch">
Template Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch_typedefs">
- <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
- Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a> useful typedefs</a></span></dt>
+ <code class="computeroutput"><span class="identifier">stopwatch</span></code> useful typedefs</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp">
Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatch_accumulator</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
@@ -60,8 +59,8 @@
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator">
Template Class <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator_typedefs">
- <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
- Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a> useful typedefs</a></span></dt>
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code> useful
+ typedefs</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_scoped_hpp">
Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopwatch_scoped</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
@@ -438,8 +437,7 @@
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch">
Template Class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch_typedefs">
- <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
- Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a> useful typedefs</a></span></dt>
+ <code class="computeroutput"><span class="identifier">stopwatch</span></code> useful typedefs</a></span></dt>
</dl></div>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
<span class="keyword">struct</span> <span class="identifier">dont_start_t</span><span class="special">;</span>
@@ -458,7 +456,7 @@
<span class="special">};</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">system_stopwatch</span><span class="special">;</span>
- <span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+ <span class="preprocessor">#ifdef</span> <span class="identifier">__</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">monotonic_stopwatch</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">above</span><span class="special">></span> <span class="identifier">high_resolution_stopwatch</span><span class="special">;</span>
@@ -546,11 +544,11 @@
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch_typedefs"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch_typedefs" title="
stopwatch useful typedefs">
- <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
- Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a> useful typedefs</a>
+ <code class="computeroutput"><span class="identifier">stopwatch</span></code> useful typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_stopwatch</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_stopwatch</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_stopwatch</span><span class="special">;</span>
@@ -571,8 +569,8 @@
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator">
Template Class <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code></a></span></dt>
<dt><span class="section"><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator_typedefs">
- <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
- Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a> useful typedefs</a></span></dt>
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code> useful
+ typedefs</a></span></dt>
</dl></div>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Accumulator</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_accumulator</span><span class="special">;</span>
@@ -588,7 +586,8 @@
<span class="special">};</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">system_stopwatch_accumulator</span><span class="special">;</span>
-<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">monotonic_stopwatch_accumulator</span><span class="special">;</span>
<span class="preprocessor">#endif</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">see</span> <span class="identifier">below</span><span class="special">></span> <span class="identifier">high_resolution_stopwatch_accumulator</span><span class="special">;</span>
@@ -629,7 +628,8 @@
A <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span><span class="special"><></span></code> is a model of a <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code> concept</a> that allows
to accumulate the time in several times instead of at once as it is the
- case of the class <code class="computeroutput"><span class="identifier">stopwatch</span><span class="special"><></span></code>.
+ case of the class <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">stopwatch_accumulator</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -816,20 +816,19 @@
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator_typedefs"></a><a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator_typedefs" title="
- stopwatch_accumulator useful typedefs">
- <a href="stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
- Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a> useful typedefs</a>
+ stopwatch_accumulator useful
+ typedefs">
+ <code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code> useful
+ typedefs</a>
</h5></div></div></div>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span> <span class="special">></span> <span class="identifier">system_stopwatch_accumulator</span><span class="special">;</span>
-</pre>
-<p>
- typedef boost::chrono::stopwatch_accumulator< boost::chrono::system_clock
- > system_stopwatch_accumulator; #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
- typedef boost::chrono::stopwatch_accumulator< boost::chrono::monotonic_clock
- > monotonic_stopwatch_accumulator; #endif typedef boost::chrono::stopwatch_accumulator<
- boost::chrono::high_resolution_clock > high_resolution_stopwatch_accumulator;
- </p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_real_cpu_clock</span> <span class="special">></span> <span class="identifier">process_real_cpu_stopwatch_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#ifdef</span> <a href="cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.BOOST_CHRONO_HAS_CLOCK_MONOTONIC" title="
+ Macro BOOST_CHRONO_HAS_CLOCK_MONOTONIC"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_MONOTONIC</span></code></a>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">monotonic_clock</span> <span class="special">></span> <span class="identifier">monotonic_stopwatch_accumulator</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">high_resolution_clock</span> <span class="special">></span> <span class="identifier">high_resolution_stopwatch_accumulator</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_real_cpu_clock</span> <span class="special">></span> <span class="identifier">process_real_cpu_stopwatch_accumulator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_user_cpu_clock</span> <span class="special">></span> <span class="identifier">process_user_cpu_stopwatch_accumulator</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopwatch_accumulator</span><span class="special"><</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_system_cpu_clock</span> <span class="special">></span> <span class="identifier">process_system_cpu_stopwatch_accumulator</span><span class="special">;</span>
</pre>
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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -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/caveat.html" title=" Caveat emptor">
+<link rel="prev" href="overview/motivation.html" title="Motivation">
<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/caveat.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/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>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -39,36 +39,25 @@
<dt><span class="section"><a href="users_guide/tutorial.html#boost_chrono.users_guide.tutorial.common_type">Common
Type</a></span></dt>
<dt><span class="section">Ratio</span></dt>
-<dt><span class="section"><a href="users_guide/tutorial.html#boost_chrono.users_guide.tutorial.clocks__time_point_and_duration">Clocks,
- time_point and duration</a></span></dt>
+<dt><span class="section">Duration</span></dt>
+<dt><span class="section">Clocks</span></dt>
+<dt><span class="section"><a href="users_guide/tutorial.html#boost_chrono.users_guide.tutorial.time_point">Time
+ Point</a></span></dt>
<dt><span class="section"><a href="users_guide/tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks">Stopwatches
and Stopclocks</a></span></dt>
<dt><span class="section">Formatters</span></dt>
</dl></dd>
<dt><span class="section">Examples</span></dt>
<dd><dl>
+<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.common_type">Common
+ type</a></span></dt>
+<dt><span class="section">Ratio</span></dt>
+<dt><span class="section">Duation</span></dt>
<dt><span class="section">Clocks</span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.how_you_override_the_duration_s_default_constructor">How
- you override the duration's default constructor</a></span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.min_utility">min
- utility</a></span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.cycle_count">Cycle
- count</a></span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.xtime_conversions">xtime
- conversions</a></span></dt>
-<dt><span class="section">xtime_clock</span></dt>
-<dt><span class="section">runtime_resolution</span></dt>
+<dt><span class="section">Conversions</span></dt>
+<dt><span class="section">Reporting</span></dt>
<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.simulated_thread_interface_demonstration_program">Simulated
thread interface demonstration program</a></span></dt>
-<dt><span class="section">Saturating</span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.howard_hinnant_s_original_demonstration_program">Howard
- Hinnant's original demonstration program</a></span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.a_tiny_program_that_times_how_long_until_a_key_is_struck">A
- tiny program that times how long until a key is struck</a></span></dt>
-<dt><span class="section">stopclock_example.cpp</span></dt>
-<dt><span class="section">stopclock_example2.cpp</span></dt>
-<dt><span class="section"><a href="users_guide/examples.html#boost_chrono.users_guide.examples.time_command">time
- command</a></span></dt>
</dl></dd>
<dt><span class="section"> External Resources</span></dt>
</dl></div>
@@ -83,7 +72,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="overview/caveat.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/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>
</div>
</body>
</html>
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/examples.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -27,47 +27,106 @@
<a name="boost_chrono.users_guide.examples"></a>Examples
</h3></div></div></div>
<div class="toc"><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.common_type">Common
+ type</a></span></dt>
+<dd><dl><dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.common_type.min_utility">min
+ utility</a></span></dt></dl></dd>
+<dt><span class="section">Ratio</span></dt>
+<dd><dl><dt><span class="section">SI-units</span></dt></dl></dd>
+<dt><span class="section">Duation</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor">How
+ you override the duration's default constructor</a></span></dt>
+<dt><span class="section">runtime_resolution</span></dt>
+<dt><span class="section">Saturating</span></dt>
+</dl></dd>
<dt><span class="section">Clocks</span></dt>
-<dd><dl><dt><span class="section">SI-units</span></dt></dl></dd>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.how_you_override_the_duration_s_default_constructor">How
- you override the duration's default constructor</a></span></dt>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.min_utility">min
- utility</a></span></dt>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.cycle_count">Cycle
- count</a></span></dt>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.xtime_conversions">xtime
- conversions</a></span></dt>
-<dt><span class="section">xtime_clock</span></dt>
-<dt><span class="section">runtime_resolution</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.clocks.cycle_count">Cycle
+ count</a></span></dt>
+<dt><span class="section">xtime_clock</span></dt>
+</dl></dd>
+<dt><span class="section">Conversions</span></dt>
+<dd><dl><dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.conversions.xtime_conversions">xtime
+ conversions</a></span></dt></dl></dd>
+<dt><span class="section">Reporting</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.reporting.a_tiny_program_that_times_how_long_until_a_key_is_struck">A
+ tiny program that times how long until a key is struck</a></span></dt>
+<dt><span class="section">stopclock_example.cpp</span></dt>
+<dt><span class="section">stopclock_example2.cpp</span></dt>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.reporting.time_command">time
+ command</a></span></dt>
+</dl></dd>
<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.simulated_thread_interface_demonstration_program">Simulated
thread interface demonstration program</a></span></dt>
-<dt><span class="section">Saturating</span></dt>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.howard_hinnant_s_original_demonstration_program">Howard
- Hinnant's original demonstration program</a></span></dt>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.a_tiny_program_that_times_how_long_until_a_key_is_struck">A
- tiny program that times how long until a key is struck</a></span></dt>
-<dt><span class="section">stopclock_example.cpp</span></dt>
-<dt><span class="section">stopclock_example2.cpp</span></dt>
-<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.time_command">time
- command</a></span></dt>
</dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.clocks"></a>Clocks
+<a name="boost_chrono.users_guide.examples.common_type"></a><a href="examples.html#boost_chrono.users_guide.examples.common_type" title="Common
+ type">Common
+ type</a>
+</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.common_type.min_utility">min
+ utility</a></span></dt></dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.common_type.min_utility"></a><a href="examples.html#boost_chrono.users_guide.examples.common_type.min_utility" title="min
+ utility">min
+ utility</a>
+</h5></div></div></div>
+<p>
+ Returns the earliest time_point.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
+<span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="identifier">min</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">></span> <span class="identifier">t1</span><span class="special">,</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="identifier">t2</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">return</span> <span class="identifier">t2</span> <span class="special"><</span> <span class="identifier">t1</span> <span class="special">?</span> <span class="identifier">t2</span> <span class="special">:</span> <span class="identifier">t1</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Being able to <span class="bold"><strong>easily</strong></span> write this function
+ is a major feature!
+ </p>
+<pre class="programlisting"><span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">t1</span><span class="special">,</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+<span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">t2</span><span class="special">,</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+<span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">t3</span><span class="special">,</span> <span class="special">(</span><span class="identifier">min</span><span class="special">)(</span><span class="identifier">t1</span><span class="special">,</span> <span class="identifier">t2</span><span class="special">));</span>
+</pre>
+<p>
+ <span class="emphasis"><em>See the source file example/min_time_point.cpp</em></span>
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.users_guide.examples.ratio"></a>Ratio
</h4></div></div></div>
-<div class="toc"><dl><dt><span class="section">SI-units</span></dt></dl></div>
+<div class="toc"><dl><dt><span class="section">SI-units</span></dt></dl></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.users_guide.examples.clocks.si_units"></a>SI-units
+<a name="boost_chrono.users_guide.examples.ratio.si_units"></a>SI-units
</h5></div></div></div>
<p>
- Type-safe "physics" code interoperating with boost::chrono::duration
- types and taking advantage of the boost::ratio infrastructure and design
+ Type-safe "physics" code interoperating with boost::chrono::
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> types and taking advantage
+ of the boost::<a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> infrastructure and design
philosophy.
</p>
<p>
- length - mimics boost::chrono::duration except restricts representation
- to double. Uses boost::ratio facilities for length units conversions.
+ length - mimics boost::chrono:: <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> except restricts representation
+ to double. Uses boost::<a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> facilities for length
+ units conversions.
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Ratio</span><span class="special">></span>
<span class="keyword">class</span> <span class="identifier">length</span> <span class="special">{</span>
@@ -98,29 +157,40 @@
<p>
Sparse sampling of length units
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">meter</span><span class="special">;</span> <span class="comment">// set meter as "unity"
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">meter</span><span class="special">;</span> <span class="comment">// set meter as "unity"
</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">centi</span><span class="special">></span> <span class="identifier">centimeter</span><span class="special">;</span> <span class="comment">// 1/100 meter
</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">kilo</span><span class="special">></span> <span class="identifier">kilometer</span><span class="special">;</span> <span class="comment">// 1000 meters
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">254</span><span class="special">,</span> <span class="number">10000</span><span class="special">></span> <span class="special">></span> <span class="identifier">inch</span><span class="special">;</span> <span class="comment">// 254/10000 meters
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">254</span><span class="special">,</span> <span class="number">10000</span><span class="special">></span> <span class="special">></span> <span class="identifier">inch</span><span class="special">;</span> <span class="comment">// 254/10000 meters
</span></pre>
<p>
- length takes ratio instead of two integral types so that definitions
- can be made like so:
+ length takes <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> instead of two integral
+ types so that definitions can be made like so:
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">12</span><span class="special">>,</span> <span class="identifier">inch</span><span class="special">::</span><span class="identifier">ratio</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">foot</span><span class="special">;</span> <span class="comment">// 12 inchs
-</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">5280</span><span class="special">>,</span> <span class="identifier">foot</span><span class="special">::</span><span class="identifier">ratio</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">mile</span><span class="special">;</span> <span class="comment">// 5280 feet
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">12</span><span class="special">>,</span> <span class="identifier">inch</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">foot</span><span class="special">;</span> <span class="comment">// 12 inchs
+</span><span class="keyword">typedef</span> <span class="identifier">length</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5280</span><span class="special">>,</span> <span class="identifier">foot</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">mile</span><span class="special">;</span> <span class="comment">// 5280 feet
</span></pre>
<p>
Need a floating point definition of seconds
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span> <span class="comment">// unity
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span> <span class="comment">// unity
</span></pre>
<p>
Demo of (scientific) support for sub-nanosecond resolutions
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">pico</span><span class="special">></span> <span class="identifier">picosecond</span><span class="special">;</span> <span class="comment">// 10^-12 seconds
-</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">femto</span><span class="special">></span> <span class="identifier">femtosecond</span><span class="special">;</span> <span class="comment">// 10^-15 seconds
-</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">atto</span><span class="special">></span> <span class="identifier">attosecond</span><span class="special">;</span> <span class="comment">// 10^-18 seconds
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">pico</span><span class="special">></span> <span class="identifier">picosecond</span><span class="special">;</span> <span class="comment">// 10^-12 seconds
+</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">femto</span><span class="special">></span> <span class="identifier">femtosecond</span><span class="special">;</span> <span class="comment">// 10^-15 seconds
+</span><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">atto</span><span class="special">></span> <span class="identifier">attosecond</span><span class="special">;</span> <span class="comment">// 10^-18 seconds
</span></pre>
<p>
A very brief proof-of-concept for SIUnits-like library. Hard-wired to
@@ -140,7 +210,9 @@
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
<span class="keyword">double</span> <span class="identifier">q_</span><span class="special">;</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -152,7 +224,9 @@
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
<span class="keyword">double</span> <span class="identifier">q_</span><span class="special">;</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -164,7 +238,9 @@
<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><></span>
-<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
+<span class="keyword">class</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span>
<span class="special">{</span>
<span class="keyword">double</span> <span class="identifier">q_</span><span class="special">;</span>
<span class="keyword">public</span><span class="special">:</span>
@@ -178,11 +254,21 @@
<p>
Example of SI-Units
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Scalar</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Time</span><span class="special">;</span> <span class="comment">// second
-</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Distance</span><span class="special">;</span> <span class="comment">// meter
-</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><-</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Speed</span><span class="special">;</span> <span class="comment">// meter/second
-</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><-</span><span class="number">2</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Acceleration</span><span class="special">;</span> <span class="comment">// meter/second^2
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Scalar</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">></span> <span class="identifier">Time</span><span class="special">;</span> <span class="comment">// second
+</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Distance</span><span class="special">;</span> <span class="comment">// meter
+</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><-</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Speed</span><span class="special">;</span> <span class="comment">// meter/second
+</span><span class="keyword">typedef</span> <span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><-</span><span class="number">2</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="identifier">Acceleration</span><span class="special">;</span> <span class="comment">// meter/second^2
</span></pre>
<p>
Quantity arithmetics
@@ -246,10 +332,16 @@
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">8</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R1</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">3</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R2</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">User1</span><span class="special">::</span><span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">,</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">RR</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">8</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R1</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3</span><span class="special">,</span> <span class="identifier">BOOST_INTMAX_C</span><span class="special">(</span><span class="number">0</span><span class="identifier">x7FFFFFFFD</span><span class="special">)></span> <span class="identifier">R2</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">User1</span><span class="special">::</span><span class="identifier">quantity</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">,</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">0</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span> <span class="special">></span> <span class="identifier">RR</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_subtract</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">type</span> <span class="identifier">RS</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">RS</span><span class="special">::</span><span class="identifier">num</span> <span class="special"><<</span> <span class="char">'/'</span> <span class="special"><<</span> <span class="identifier">RS</span><span class="special">::</span><span class="identifier">den</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">;</span>
@@ -298,15 +390,25 @@
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.how_you_override_the_duration_s_default_constructor"></a><a href="examples.html#boost_chrono.users_guide.examples.how_you_override_the_duration_s_default_constructor" title="How
- you override the duration's default constructor">How
- you override the duration's default constructor</a>
+<a name="boost_chrono.users_guide.examples.duation"></a>Duation
</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor">How
+ you override the duration's default constructor</a></span></dt>
+<dt><span class="section">runtime_resolution</span></dt>
+<dt><span class="section">Saturating</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor"></a><a href="examples.html#boost_chrono.users_guide.examples.duation.how_you_override_the_duration_s_default_constructor" title="How
+ you override the duration's default constructor">How
+ you override the duration's default constructor</a>
+</h5></div></div></div>
<p>
- Next follows how you override the duration's default constructor to do
- anything you want (in this case zero). All we need to do is to change the
- representation
- </p>
+ Next follows how you override the duration's default constructor to do
+ anything you want (in this case zero). All we need to do is to change
+ the representation
+ </p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">I_dont_like_the_default_duration_behavior</span> <span class="special">{</span>
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">R</span><span class="special">></span>
@@ -346,74 +448,145 @@
<span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">zero_default</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">zero_default</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">x</span> <span class="special"><</span> <span class="identifier">y</span><span class="special">);}</span>
<span class="special">};</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">nano</span> <span class="special">></span> <span class="identifier">nanoseconds</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">micro</span> <span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">milli</span> <span class="special">></span> <span class="identifier">milliseconds</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">></span> <span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span>
-<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">hours</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">nano</span> <span class="special">></span> <span class="identifier">nanoseconds</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">micro</span> <span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">milli</span> <span class="special">></span> <span class="identifier">milliseconds</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">></span> <span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">zero_default</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">hours</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
- Usage
- </p>
+ Usage
+ </p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">I_dont_like_the_default_duration_behavior</span><span class="special">;</span>
<span class="identifier">milliseconds</span> <span class="identifier">ms</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">ms</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">;</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file example/i_dont_like_the_default_duration_behavior.cpp</em></span>
- </p>
+ <span class="emphasis"><em>See the source file example/i_dont_like_the_default_duration_behavior.cpp</em></span>
+ </p>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.min_utility"></a><a href="examples.html#boost_chrono.users_guide.examples.min_utility" title="min
- utility">min
- utility</a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.duation.runtime_resolution"></a>runtime_resolution
+</h5></div></div></div>
<p>
- Returns the earliest time_point.
- </p>
-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration2</span><span class="special">></span>
-<span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">common_type</span><span class="special"><</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span>
- <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
-<span class="identifier">min</span><span class="special">(</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">></span> <span class="identifier">t1</span><span class="special">,</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="identifier">t2</span><span class="special">)</span>
+ Handle duration with resolution not known until run time
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">duration</span>
<span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">t2</span> <span class="special"><</span> <span class="identifier">t1</span> <span class="special">?</span> <span class="identifier">t2</span> <span class="special">:</span> <span class="identifier">t1</span><span class="special">;</span>
-<span class="special">}</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">rep</span><span class="special">;</span>
+<span class="keyword">private</span><span class="special">:</span>
+ <span class="identifier">rep</span> <span class="identifier">rep_</span><span class="special">;</span>
+
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">ticks_per_nanosecond</span><span class="special">;</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">nano</span><span class="special">></span> <span class="identifier">tonanosec</span><span class="special">;</span>
+
+ <span class="identifier">duration</span><span class="special">()</span> <span class="special">{}</span> <span class="comment">// = default;
+</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">r</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">rep_</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span> <span class="special">{}</span>
+
+ <span class="comment">// conversions
+</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">tonanosec</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">rep_</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special">*</span> <span class="identifier">ticks_per_nanosecond</span><span class="special">))</span> <span class="special">{}</span>
+
+ <span class="comment">// explicit
+</span> <span class="keyword">operator</span> <span class="identifier">tonanosec</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">tonanosec</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">/</span><span class="identifier">ticks_per_nanosecond</span><span class="special">);}</span>
+
+ <span class="comment">// observer
+</span>
+ <span class="identifier">rep</span> <span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">rep_</span><span class="special">;}</span>
+
+ <span class="comment">// arithmetic
+</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">+=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">+=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="identifier">rep</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">*=</span> <span class="identifier">rhs</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="identifier">rep</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">/=</span> <span class="identifier">rhs</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+
+ <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">duration</span><span class="special">(-</span><span class="identifier">rep_</span><span class="special">);}</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">++()</span> <span class="special">{++</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">duration</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">++);}</span>
+ <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">--()</span> <span class="special">{--</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
+ <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">duration</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">--);}</span>
+
+ <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+=</span> <span class="identifier">y</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">-=</span> <span class="identifier">y</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">*(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">rep</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">*=</span> <span class="identifier">y</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">*(</span><span class="identifier">rep</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">y</span> <span class="special">*=</span> <span class="identifier">x</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">rep</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">/=</span> <span class="identifier">y</span><span class="special">;}</span>
+
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">rep_</span> <span class="special">==</span> <span class="identifier">y</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">y</span><span class="special">);}</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">rep_</span> <span class="special"><</span> <span class="identifier">y</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">y</span> <span class="special"><</span> <span class="identifier">x</span><span class="special">);}</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">y</span> <span class="special"><</span> <span class="identifier">x</span><span class="special">;}</span>
+ <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">x</span> <span class="special"><</span> <span class="identifier">y</span><span class="special">);}</span>
+<span class="special">};</span>
</pre>
<p>
- Being able to <span class="bold"><strong>easily</strong></span> write this function
- is a major feature!
- </p>
-<pre class="programlisting"><span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">t1</span><span class="special">,</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
-<span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">t2</span><span class="special">,</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
-<span class="identifier">BOOST_AUTO</span><span class="special">(</span><span class="identifier">t3</span><span class="special">,</span> <span class="special">(</span><span class="identifier">min</span><span class="special">)(</span><span class="identifier">t1</span><span class="special">,</span> <span class="identifier">t2</span><span class="special">));</span>
-</pre>
+ <span class="emphasis"><em>See the source file here</em></span>
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.duation.saturating"></a>Saturating
+</h5></div></div></div>
<p>
- <span class="emphasis"><em>See the source file example/min_time_point.cpp</em></span>
- </p>
+ A "saturating" signed integral type is developed. This type
+ has +/- infinity and a nan (like IEEE floating point) but otherwise obeys
+ signed integral arithmetic. This class is subsequently used as the rep
+ in boost::chrono:: <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> to demonstrate a duration
+ class that does not silently ignore overflow.
+ </p>
+<p>
+ <span class="emphasis"><em>See the source file example/satutating.cpp</em></span>
+ </p>
+</div>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.cycle_count"></a><a href="examples.html#boost_chrono.users_guide.examples.cycle_count" title="Cycle
- count">Cycle
- count</a>
+<a name="boost_chrono.users_guide.examples.clocks"></a>Clocks
</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.clocks.cycle_count">Cycle
+ count</a></span></dt>
+<dt><span class="section">xtime_clock</span></dt>
+</dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.clocks.cycle_count"></a><a href="examples.html#boost_chrono.users_guide.examples.clocks.cycle_count" title="Cycle
+ count">Cycle
+ count</a>
+</h5></div></div></div>
<p>
- Users can easily create their own clocks, with both points in time and
- time durations which have a representation and precision of their own choosing.
- For example if there is a hardware counter which simply increments a count
- with each cycle of the cpu, one can very easily build clocks, time points
- and durations on top of that, using only a few tens of lines of code. Such
- systems can be used to call the time-sensitive threading API's such as
- sleep, wait on a condition variable, or wait for a mutex lock. The API
- proposed herein is not sensitive as to whether this is a 300MHz clock (with
- a 3 1/3 nanosecond tick period) or a 3GHz clock (with a tick period of
- 1/3 of a nanosecond). And the resulting code will be just as efficient
- as if the user wrote a special purpose clock cycle counter.
- </p>
+ Users can easily create their own clocks, with both points in time and
+ time durations which have a representation and precision of their own
+ choosing. For example if there is a hardware counter which simply increments
+ a count with each cycle of the cpu, one can very easily build clocks,
+ time points and durations on top of that, using only a few tens of lines
+ of code. Such systems can be used to call the time-sensitive threading
+ API's such as sleep, wait on a condition variable, or wait for a mutex
+ lock. The API proposed herein is not sensitive as to whether this is
+ a 300MHz clock (with a 3 1/3 nanosecond tick period) or a 3GHz clock
+ (with a tick period of 1/3 of a nanosecond). And the resulting code will
+ be just as efficient as if the user wrote a special purpose clock cycle
+ counter.
+ </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
@@ -425,11 +598,15 @@
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">speed</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">cycle_count</span>
<span class="special">{</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="identifier">speed</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mega</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">frequency</span><span class="special">;</span> <span class="comment">// Mhz
-</span> <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">frequency</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">period</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_multiply</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="identifier">speed</span><span class="special">>,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mega</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">frequency</span><span class="special">;</span> <span class="comment">// Mhz
+</span> <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">>,</span> <span class="identifier">frequency</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">period</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">rep</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">period</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">cycle_count</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">period</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">cycle_count</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">()</span>
<span class="special">{</span>
@@ -447,7 +624,8 @@
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">nanosec_per_sec</span> <span class="special">=</span> <span class="identifier">period</span><span class="special">::</span><span class="identifier">den</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">approx_cycle_count</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">approx_cycle_count</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">()</span>
<span class="special">{</span>
@@ -459,103 +637,17 @@
<span class="special">};</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file here</em></span>
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.xtime_conversions"></a><a href="examples.html#boost_chrono.users_guide.examples.xtime_conversions" title="xtime
- conversions">xtime
- conversions</a>
-</h4></div></div></div>
-<p>
- Example round_up utility: converts d to To, rounding up for inexact conversions
- Being able to <span class="bold"><strong>easily</strong></span> write this function
- is a major feature!
- </p>
-<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-
-<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
-
-<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-
-<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</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">></span>
-<span class="identifier">To</span>
-<span class="identifier">round_up</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">To</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">To</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">result</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">++</span><span class="identifier">result</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
-<p>
- Demonstrate interaction with xtime-like facility:
- </p>
-<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">xtime</span>
-<span class="special">{</span>
- <span class="keyword">long</span> <span class="identifier">sec</span><span class="special">;</span>
- <span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="identifier">usec</span><span class="special">;</span>
-<span class="special">};</span>
-
-<span class="keyword">template</span> <span class="special"><</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">></span>
-<span class="identifier">xtime</span>
-<span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">;</span>
- <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">seconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">());</span>
- <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
- <span class="keyword">return</span> <span class="identifier">xt</span><span class="special">;</span>
-<span class="special">}</span>
-
-<span class="keyword">template</span> <span class="special"><</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">></span>
-<span class="identifier">xtime</span>
-<span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">;</span>
- <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">seconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">());</span>
- <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">>(</span><span class="identifier">round_up</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
- <span class="keyword">return</span> <span class="identifier">xt</span><span class="special">;</span>
-<span class="special">}</span>
-
-<span class="identifier">microseconds</span>
-<span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="keyword">return</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">microseconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span><span class="special">);</span>
-<span class="special">}</span>
-
-<span class="keyword">void</span> <span class="identifier">print</span><span class="special">(</span><span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">)</span>
-<span class="special">{</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="char">'{'</span> <span class="special"><<</span> <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special"><<</span> <span class="char">','</span> <span class="special"><<</span> <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special"><<</span> <span class="string">"}\n"</span><span class="special">;</span>
-<span class="special">}</span>
-</pre>
-<p>
- Usage
- </p>
-<pre class="programlisting"><span class="identifier">xtime</span> <span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">milliseconds</span><span class="special">(</span><span class="number">251</span><span class="special">));</span>
-<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-<span class="identifier">milliseconds</span> <span class="identifier">ms</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">milliseconds</span><span class="special">>(</span><span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xt</span><span class="special">));</span>
-<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">ms</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" milliseconds\n"</span><span class="special">;</span>
-<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">ms</span><span class="special">);</span>
-<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">999</span><span class="special">));</span>
-<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">999</span><span class="special">));</span>
-<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
-</pre>
-<p>
- <span class="emphasis"><em>See the source file here</em></span>
- </p>
+ <span class="emphasis"><em>See the source file here</em></span>
+ </p>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.xtime_clock"></a>xtime_clock
-</h4></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.clocks.xtime_clock"></a>xtime_clock
+</h5></div></div></div>
<p>
- This example demonstrates the use of a timeval-like struct to be used as
- the representation type for both duraiton and time_point.
- </p>
+ This example demonstrates the use of a timeval-like struct to be used
+ as the representation type for both duraiton and time_point.
+ </p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">xtime</span> <span class="special">{</span>
<span class="keyword">private</span><span class="special">:</span>
<span class="keyword">long</span> <span class="identifier">tv_sec</span><span class="special">;</span>
@@ -638,15 +730,17 @@
<span class="special">};</span>
</pre>
<p>
- Clock based on timeval-like struct.
- </p>
+ Clock based on timeval-like struct.
+ </p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">xtime_clock</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="keyword">typedef</span> <span class="identifier">xtime</span> <span class="identifier">rep</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">micro</span> <span class="identifier">period</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">period</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">xtime_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">period</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">xtime_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">()</span>
<span class="special">{</span>
@@ -675,8 +769,8 @@
<span class="special">};</span>
</pre>
<p>
- Usage of xtime_clock
- </p>
+ Usage of xtime_clock
+ </p>
<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"sizeof xtime_clock::time_point = "</span> <span class="special"><<</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">xtime_clock</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">)</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"sizeof xtime_clock::duration = "</span> <span class="special"><<</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">xtime_clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">)</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">;</span>
@@ -689,248 +783,123 @@
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"paused "</span> <span class="special"><<</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="identifier">elapsed</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" nanoseconds\n"</span><span class="special">;</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file example/timeval_demo.cpp</em></span>
- </p>
+ <span class="emphasis"><em>See the source file example/timeval_demo.cpp</em></span>
+ </p>
+</div>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.runtime_resolution"></a>runtime_resolution
+<a name="boost_chrono.users_guide.examples.conversions"></a>Conversions
</h4></div></div></div>
+<div class="toc"><dl><dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.conversions.xtime_conversions">xtime
+ conversions</a></span></dt></dl></div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.conversions.xtime_conversions"></a><a href="examples.html#boost_chrono.users_guide.examples.conversions.xtime_conversions" title="xtime
+ conversions">xtime
+ conversions</a>
+</h5></div></div></div>
<p>
- Handle duration with resolution not known until run time
- </p>
-<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">duration</span>
-<span class="special">{</span>
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">typedef</span> <span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">rep</span><span class="special">;</span>
-<span class="keyword">private</span><span class="special">:</span>
- <span class="identifier">rep</span> <span class="identifier">rep_</span><span class="special">;</span>
-
- <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">ticks_per_nanosecond</span><span class="special">;</span>
-
-<span class="keyword">public</span><span class="special">:</span>
- <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">nano</span><span class="special">></span> <span class="identifier">tonanosec</span><span class="special">;</span>
+ Example round_up utility: converts d to To, rounding up for inexact conversions
+ Being able to <span class="bold"><strong>easily</strong></span> write this function
+ is a major feature!
+ </p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
- <span class="identifier">duration</span><span class="special">()</span> <span class="special">{}</span> <span class="comment">// = default;
-</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">r</span><span class="special">)</span> <span class="special">:</span> <span class="identifier">rep_</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span> <span class="special">{}</span>
+<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
- <span class="comment">// conversions
-</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">tonanosec</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">:</span> <span class="identifier">rep_</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special">*</span> <span class="identifier">ticks_per_nanosecond</span><span class="special">))</span> <span class="special">{}</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
- <span class="comment">// explicit
-</span> <span class="keyword">operator</span> <span class="identifier">tonanosec</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">tonanosec</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">/</span><span class="identifier">ticks_per_nanosecond</span><span class="special">);}</span>
-
- <span class="comment">// observer
-</span>
- <span class="identifier">rep</span> <span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">rep_</span><span class="special">;}</span>
-
- <span class="comment">// arithmetic
-</span>
- <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">+=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
- <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">+=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
- <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="identifier">rep</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">*=</span> <span class="identifier">rhs</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
- <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="identifier">rep</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="special">{</span><span class="identifier">rep_</span> <span class="special">/=</span> <span class="identifier">rhs</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
-
- <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
- <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">duration</span><span class="special">(-</span><span class="identifier">rep_</span><span class="special">);}</span>
- <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">++()</span> <span class="special">{++</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
- <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">duration</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">++);}</span>
- <span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">--()</span> <span class="special">{--</span><span class="identifier">rep_</span><span class="special">;</span> <span class="keyword">return</span> <span class="special">*</span><span class="keyword">this</span><span class="special">;}</span>
- <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">duration</span><span class="special">(</span><span class="identifier">rep_</span><span class="special">--);}</span>
-
- <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+=</span> <span class="identifier">y</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">-=</span> <span class="identifier">y</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">*(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">rep</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">*=</span> <span class="identifier">y</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">*(</span><span class="identifier">rep</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">y</span> <span class="special">*=</span> <span class="identifier">x</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="identifier">duration</span> <span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">rep</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span> <span class="special">/=</span> <span class="identifier">y</span><span class="special">;}</span>
-
- <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">rep_</span> <span class="special">==</span> <span class="identifier">y</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">x</span> <span class="special">==</span> <span class="identifier">y</span><span class="special">);}</span>
- <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">x</span><span class="special">.</span><span class="identifier">rep_</span> <span class="special"><</span> <span class="identifier">y</span><span class="special">.</span><span class="identifier">rep_</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">y</span> <span class="special"><</span> <span class="identifier">x</span><span class="special">);}</span>
- <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="identifier">y</span> <span class="special"><</span> <span class="identifier">x</span><span class="special">;}</span>
- <span class="keyword">friend</span> <span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span> <span class="identifier">x</span><span class="special">,</span> <span class="identifier">duration</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span><span class="keyword">return</span> <span class="special">!(</span><span class="identifier">x</span> <span class="special"><</span> <span class="identifier">y</span><span class="special">);}</span>
-<span class="special">};</span>
-</pre>
-<p>
- <span class="emphasis"><em>See the source file here</em></span>
- </p>
-</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.simulated_thread_interface_demonstration_program"></a><a href="examples.html#boost_chrono.users_guide.examples.simulated_thread_interface_demonstration_program" title="Simulated
- thread interface demonstration program">Simulated
- thread interface demonstration program</a>
-</h4></div></div></div>
-<p>
- Free sleep functions
- </p>
-<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">this_thread</span> <span class="special">{</span>
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</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">></span>
+<span class="identifier">To</span>
+<span class="identifier">round_up</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">To</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">To</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">result</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">++</span><span class="identifier">result</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="identifier">result</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Demonstrate interaction with xtime-like facility:
+ </p>
+<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">xtime</span>
+<span class="special">{</span>
+ <span class="keyword">long</span> <span class="identifier">sec</span><span class="special">;</span>
+ <span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="identifier">usec</span><span class="special">;</span>
+<span class="special">};</span>
<span class="keyword">template</span> <span class="special"><</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">></span>
-<span class="keyword">void</span> <span class="identifier">sleep_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">++</span><span class="identifier">t</span><span class="special">;</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special">></span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">0</span><span class="special">))</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"sleep_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
+<span class="identifier">xtime</span>
+<span class="identifier">to_xtime_truncate</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">;</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">seconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="keyword">return</span> <span class="identifier">xt</span><span class="special">;</span>
<span class="special">}</span>
-<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
-<span class="keyword">void</span> <span class="identifier">sleep_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="identifier">Time</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special">></span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span> <span class="special">{</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">common_type</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
- <span class="keyword">typename</span> <span class="identifier">SysTime</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
- <span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">us</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
- <span class="special">++</span><span class="identifier">us</span><span class="special">;</span>
- <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"sleep_until "</span><span class="special">;</span>
- <span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
- <span class="special">}</span>
+<span class="keyword">template</span> <span class="special"><</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">></span>
+<span class="identifier">xtime</span>
+<span class="identifier">to_xtime_round_up</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">;</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">long</span><span class="special">>(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">seconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special">=</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">>(</span><span class="identifier">round_up</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span> <span class="special">-</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)).</span><span class="identifier">count</span><span class="special">());</span>
+ <span class="keyword">return</span> <span class="identifier">xt</span><span class="special">;</span>
<span class="special">}</span>
-<span class="special">}}</span>
-</pre>
-<p>
- timed_mutex modified fuctions
- </p>
-<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
-<span class="keyword">struct</span> <span class="identifier">timed_mutex</span> <span class="special">{</span>
- <span class="comment">// ...
-</span>
- <span class="keyword">template</span> <span class="special"><</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">></span>
- <span class="keyword">bool</span> <span class="identifier">try_lock_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">0</span><span class="special">))</span>
- <span class="keyword">return</span> <span class="identifier">try_lock</span><span class="special">();</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"try_lock_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
- <span class="special">}</span>
-
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="identifier">try_lock_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">)</span>
- <span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="identifier">Time</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span>
- <span class="keyword">return</span> <span class="identifier">try_lock</span><span class="special">();</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">common_type</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
- <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
- <span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"try_lock_until "</span><span class="special">;</span>
- <span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span>
- <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
- <span class="special">}</span>
-<span class="special">};</span>
-<span class="special">}</span>
-</pre>
-<p>
- condition_variable modified fuctions
- </p>
-<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
-<span class="keyword">struct</span> <span class="identifier">condition_variable</span>
+<span class="identifier">microseconds</span>
+<span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">)</span>
<span class="special">{</span>
- <span class="comment">// ...
-</span>
- <span class="keyword">template</span> <span class="special"><</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">></span>
- <span class="keyword">bool</span> <span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"wait_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
- <span class="special">}</span>
+ <span class="keyword">return</span> <span class="identifier">seconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">microseconds</span><span class="special">(</span><span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span><span class="special">);</span>
+<span class="special">}</span>
- <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
- <span class="keyword">bool</span> <span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
- <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="identifier">Time</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
- <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span>
- <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
- <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">common_type</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
- <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
- <span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
- <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
- <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"wait_until "</span><span class="special">;</span>
- <span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</span><span class="special">);</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span>
- <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
- <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
- <span class="special">}</span>
-<span class="special">};</span>
+<span class="keyword">void</span> <span class="identifier">print</span><span class="special">(</span><span class="identifier">xtime</span> <span class="identifier">xt</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="char">'{'</span> <span class="special"><<</span> <span class="identifier">xt</span><span class="special">.</span><span class="identifier">sec</span> <span class="special"><<</span> <span class="char">','</span> <span class="special"><<</span> <span class="identifier">xt</span><span class="special">.</span><span class="identifier">usec</span> <span class="special"><<</span> <span class="string">"}\n"</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
- Usage
- </p>
-<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span> <span class="identifier">m</span><span class="special">;</span>
-<span class="identifier">boost</span><span class="special">::</span><span class="identifier">timed_mutex</span> <span class="identifier">mut</span><span class="special">;</span>
-<span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span> <span class="identifier">cv</span><span class="special">;</span>
-
-<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
-<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
-
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">300</span><span class="special">));</span>
-<span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">time_limit</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">seconds</span><span class="special">(</span><span class="number">4</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">milliseconds</span><span class="special">(</span><span class="number">500</span><span class="special">);</span>
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span><span class="identifier">time_limit</span><span class="special">);</span>
-
-<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_for</span><span class="special">(</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">30</span><span class="special">));</span>
-<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_until</span><span class="special">(</span><span class="identifier">time_limit</span><span class="special">);</span>
-
-<span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">m</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="comment">// real code would put this in a loop
-</span><span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">m</span><span class="special">,</span> <span class="identifier">time_limit</span><span class="special">);</span> <span class="comment">// real code would put this in a loop
-</span>
-<span class="comment">// For those who prefer floating point
-</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">0.25</span><span class="special">));</span>
-<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">1.5</span><span class="special">));</span>
+ Usage
+ </p>
+<pre class="programlisting"><span class="identifier">xtime</span> <span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">milliseconds</span><span class="special">(</span><span class="number">251</span><span class="special">));</span>
+<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
+<span class="identifier">milliseconds</span> <span class="identifier">ms</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">milliseconds</span><span class="special">>(</span><span class="identifier">from_xtime</span><span class="special">(</span><span class="identifier">xt</span><span class="special">));</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">ms</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" milliseconds\n"</span><span class="special">;</span>
+<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">ms</span><span class="special">);</span>
+<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
+<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_truncate</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">999</span><span class="special">));</span>
+<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
+<span class="identifier">xt</span> <span class="special">=</span> <span class="identifier">to_xtime_round_up</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">999</span><span class="special">));</span>
+<span class="identifier">print</span><span class="special">(</span><span class="identifier">xt</span><span class="special">);</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file example/simulated_thread_interface_demo.cpp</em></span>
- </p>
+ <span class="emphasis"><em>See the source file here</em></span>
+ </p>
</div>
-<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.saturating"></a>Saturating
-</h4></div></div></div>
-<p>
- A "saturating" signed integral type is developed. This type has
- +/- infinity and a nan (like IEEE floating point) but otherwise obeys signed
- integral arithmetic. This class is subsequently used as the rep in boost::chrono::duration
- to demonstrate a duration class that does not silently ignore overflow.
- </p>
-<p>
- <span class="emphasis"><em>See the source file example/satutating.cpp</em></span>
- </p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.howard_hinnant_s_original_demonstration_program"></a><a href="examples.html#boost_chrono.users_guide.examples.howard_hinnant_s_original_demonstration_program" title="Howard
- Hinnant's original demonstration program">Howard
- Hinnant's original demonstration program</a>
+<a name="boost_chrono.users_guide.examples.reporting"></a>Reporting
</h4></div></div></div>
-<p>
- <span class="emphasis"><em>See the source file example/time2_demo.cpp</em></span>
- </p>
-</div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.reporting.a_tiny_program_that_times_how_long_until_a_key_is_struck">A
+ tiny program that times how long until a key is struck</a></span></dt>
+<dt><span class="section">stopclock_example.cpp</span></dt>
+<dt><span class="section">stopclock_example2.cpp</span></dt>
+<dt><span class="section"><a href="examples.html#boost_chrono.users_guide.examples.reporting.time_command">time
+ command</a></span></dt>
+</dl></div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.a_tiny_program_that_times_how_long_until_a_key_is_struck"></a><a href="examples.html#boost_chrono.users_guide.examples.a_tiny_program_that_times_how_long_until_a_key_is_struck" title="A
- tiny program that times how long until a key is struck">A
- tiny program that times how long until a key is struck</a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.reporting.a_tiny_program_that_times_how_long_until_a_key_is_struck"></a><a href="examples.html#boost_chrono.users_guide.examples.reporting.a_tiny_program_that_times_how_long_until_a_key_is_struck" title="A
+ tiny program that times how long until a key is struck">A
+ tiny program that times how long until a key is struck</a>
+</h5></div></div></div>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iomanip</span><span class="special">></span>
@@ -997,23 +966,23 @@
<span class="special">}</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file example/await_keystroke.cpp</em></span>
- </p>
+ <span class="emphasis"><em>See the source file example/await_keystroke.cpp</em></span>
+ </p>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.stopclock_example_cpp"></a>stopclock_example.cpp
-</h4></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.reporting.stopclock_example_cpp"></a>stopclock_example.cpp
+</h5></div></div></div>
<p>
- Here is the stopclock_example.cpp program supplied with the Boost Chrono
- library:
- </p>
+ Here is the stopclock_example.cpp program supplied with the Boost Chrono
+ library:
+ </p>
<p>
- When the <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span>
- <span class="identifier">t</span></code> object is created, it starts
- timing. When it is destroyed at the end of the program, its destructor
- stops the time counting and displays timing information on cout.
- </p>
+ When the <code class="computeroutput"><span class="identifier">stopclock</span><span class="special"><></span>
+ <span class="identifier">t</span></code> object is created, it starts
+ timing. When it is destroyed at the end of the program, its destructor
+ stops the time counting and displays timing information on cout.
+ </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cmath</span><span class="special">></span>
@@ -1028,28 +997,28 @@
<span class="special">}</span>
</pre>
<p>
- The output of this program run looks like this:
- </p>
+ The output of this program run looks like this:
+ </p>
<pre class="programlisting"><span class="identifier">wall</span> <span class="number">0.42</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">user</span> <span class="number">0.41</span> <span class="identifier">s</span> <span class="special">+</span> <span class="identifier">system</span> <span class="number">0.00</span> <span class="identifier">s</span> <span class="special">=</span> <span class="identifier">total</span> <span class="identifier">cpu</span> <span class="number">0.41</span> <span class="identifier">s</span><span class="special">,</span> <span class="special">(</span><span class="number">96.3</span><span class="special">%)</span>
</pre>
<p>
- In other words, this program ran in 0.42 seconds as would be measured by
- a clock on the wall, the operating system charged it for 0.41 seconds of
- user CPU time and 0 seconds of system CPU time, the total of these two
- was 0.41, and that represented 96.3 percent of the wall clock time.
- </p>
+ In other words, this program ran in 0.42 seconds as would be measured
+ by a clock on the wall, the operating system charged it for 0.41 seconds
+ of user CPU time and 0 seconds of system CPU time, the total of these
+ two was 0.41, and that represented 96.3 percent of the wall clock time.
+ </p>
<p>
- <span class="emphasis"><em>See the source file example/stopclock_example.cpp</em></span>
- </p>
+ <span class="emphasis"><em>See the source file example/stopclock_example.cpp</em></span>
+ </p>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.stopclock_example2_cpp"></a>stopclock_example2.cpp
-</h4></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.reporting.stopclock_example2_cpp"></a>stopclock_example2.cpp
+</h5></div></div></div>
<p>
- The stopclock_example2.cpp program is the same, except that it supplies
- additional constructor arguments from the command line:
- </p>
+ The stopclock_example2.cpp program is the same, except that it supplies
+ additional constructor arguments from the command line:
+ </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cmath</span><span class="special">></span>
@@ -1067,8 +1036,9 @@
<span class="special">}</span>
</pre>
<p>
- Here is the output for this program for several sets of command line arguments:
- </p>
+ Here is the output for this program for several sets of command line
+ arguments:
+ </p>
<pre class="programlisting"><span class="identifier">stopclock_example2</span>
<span class="number">0.42</span> <span class="identifier">cpu</span> <span class="identifier">seconds</span>
@@ -1082,15 +1052,15 @@
<span class="number">0.422</span> <span class="identifier">total</span> <span class="identifier">CPU</span> <span class="identifier">seconds</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file example/stopclock_example2.cpp</em></span>
- </p>
+ <span class="emphasis"><em>See the source file example/stopclock_example2.cpp</em></span>
+ </p>
</div>
<div class="section" lang="en">
-<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.examples.time_command"></a><a href="examples.html#boost_chrono.users_guide.examples.time_command" title="time
- command">time
- command</a>
-</h4></div></div></div>
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.examples.reporting.time_command"></a><a href="examples.html#boost_chrono.users_guide.examples.reporting.time_command" title="time
+ command">time
+ command</a>
+</h5></div></div></div>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">stopclock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">cstdlib</span><span class="special">></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">string</span><span class="special">></span>
@@ -1131,7 +1101,171 @@
<span class="special">}</span>
</pre>
<p>
- <span class="emphasis"><em>See the source file example/timex.cpp</em></span>
+ <span class="emphasis"><em>See the source file example/timex.cpp</em></span>
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.users_guide.examples.simulated_thread_interface_demonstration_program"></a><a href="examples.html#boost_chrono.users_guide.examples.simulated_thread_interface_demonstration_program" title="Simulated
+ thread interface demonstration program">Simulated
+ thread interface demonstration program</a>
+</h4></div></div></div>
+<p>
+ The C++0x standard library's multi-threading library requires the ability
+ to deal with the representation of time in a manner consistent with modern
+ C++ practices. Next follows a simaulation of this interface.
+ </p>
+<p>
+ Free sleep functions
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">this_thread</span> <span class="special">{</span>
+
+<span class="keyword">template</span> <span class="special"><</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">></span>
+<span class="keyword">void</span> <span class="identifier">sleep_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">++</span><span class="identifier">t</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special">></span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">0</span><span class="special">))</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"sleep_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
+<span class="special">}</span>
+
+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
+<span class="keyword">void</span> <span class="identifier">sleep_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="identifier">Time</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special">></span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span> <span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">SysTime</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
+ <span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">us</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">++</span><span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"sleep_until "</span><span class="special">;</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">}</span>
+
+<span class="special">}}</span>
+</pre>
+<p>
+ timed_mutex modified fuctions
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">struct</span> <span class="identifier">timed_mutex</span> <span class="special">{</span>
+ <span class="comment">// ...
+</span>
+ <span class="keyword">template</span> <span class="special"><</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">></span>
+ <span class="keyword">bool</span> <span class="identifier">try_lock_for</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">0</span><span class="special">))</span>
+ <span class="keyword">return</span> <span class="identifier">try_lock</span><span class="special">();</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"try_lock_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="identifier">try_lock_until</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="identifier">Time</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span>
+ <span class="keyword">return</span> <span class="identifier">try_lock</span><span class="special">();</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
+ <span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"try_lock_until "</span><span class="special">;</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span>
+ <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+<span class="special">}</span>
+</pre>
+<p>
+ condition_variable modified fuctions
+ </p>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
+<span class="keyword">struct</span> <span class="identifier">condition_variable</span>
+<span class="special">{</span>
+ <span class="comment">// ...
+</span>
+ <span class="keyword">template</span> <span class="special"><</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">></span>
+ <span class="keyword">bool</span> <span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"wait_for "</span> <span class="special"><<</span> <span class="identifier">t</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" microseconds\n"</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+
+ <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
+ <span class="keyword">bool</span> <span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">mutex</span><span class="special">&,</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="identifier">Time</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">SysTime</span><span class="special">;</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">t</span> <span class="special"><=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">())</span>
+ <span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">boost</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Time</span><span class="special">::</span><span class="identifier">duration</span><span class="special">,</span>
+ <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">D</span><span class="special">;</span>
+ <span class="comment">/* auto */</span> <span class="identifier">D</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <span class="identifier">microseconds</span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">microseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="identifier">SysTime</span> <span class="identifier">st</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">us</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"wait_until "</span><span class="special">;</span>
+ <span class="identifier">detail</span><span class="special">::</span><span class="identifier">print_time</span><span class="special">(</span><span class="identifier">st</span><span class="special">);</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">" which is "</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">st</span> <span class="special">-</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()).</span><span class="identifier">count</span><span class="special">()</span>
+ <span class="special"><<</span> <span class="string">" microseconds away\n"</span><span class="special">;</span>
+ <span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Usage
+ </p>
+<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mutex</span> <span class="identifier">m</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">timed_mutex</span> <span class="identifier">mut</span><span class="special">;</span>
+<span class="identifier">boost</span><span class="special">::</span><span class="identifier">condition_variable</span> <span class="identifier">cv</span><span class="special">;</span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">seconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span><span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">300</span><span class="special">));</span>
+<span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">time_limit</span> <span class="special">=</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">seconds</span><span class="special">(</span><span class="number">4</span><span class="special">)</span> <span class="special">+</span> <span class="identifier">milliseconds</span><span class="special">(</span><span class="number">500</span><span class="special">);</span>
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span><span class="identifier">time_limit</span><span class="special">);</span>
+
+<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_for</span><span class="special">(</span><span class="identifier">milliseconds</span><span class="special">(</span><span class="number">30</span><span class="special">));</span>
+<span class="identifier">mut</span><span class="special">.</span><span class="identifier">try_lock_until</span><span class="special">(</span><span class="identifier">time_limit</span><span class="special">);</span>
+
+<span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_for</span><span class="special">(</span><span class="identifier">m</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="comment">// real code would put this in a loop
+</span><span class="identifier">cv</span><span class="special">.</span><span class="identifier">wait_until</span><span class="special">(</span><span class="identifier">m</span><span class="special">,</span> <span class="identifier">time_limit</span><span class="special">);</span> <span class="comment">// real code would put this in a loop
+</span>
+<span class="comment">// For those who prefer floating point
+</span><span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_for</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">0.25</span><span class="special">));</span>
+<span class="identifier">this_thread</span><span class="special">::</span><span class="identifier">sleep_until</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">1.5</span><span class="special">));</span>
+</pre>
+<p>
+ <span class="emphasis"><em>See the source file example/simulated_thread_interface_demo.cpp</em></span>
</p>
</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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -39,7 +39,7 @@
Installing Chrono</a>
</h4></div></div></div>
<a name="boost_chrono.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4819332"></a>
+<a name="id4759219"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.getting__emphasis_role__bold__boost_chrono__emphasis__">Getting
<span class="bold"><strong>Boost.Chrono</strong></span> </a>
</h5>
@@ -54,7 +54,7 @@
and follow the instructions there for anonymous SVN access.
</p>
<a name="boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___"></a><h5>
-<a name="id4819401"></a>
+<a name="id4759289"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.where_to_install__emphasis_role__bold__boost_chrono__emphasis___">Where
to install <span class="bold"><strong>Boost.Chrono</strong></span>? </a>
</h5>
@@ -70,7 +70,7 @@
variable. Any help is welcome.
</p>
<a name="boost_chrono.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4819443"></a>
+<a name="id4759331"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building__emphasis_role__bold__boost_chrono__emphasis__">Building
<span class="bold"><strong>Boost.Chrono</strong></span> </a>
</h5>
@@ -81,7 +81,7 @@
<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="id4819511"></a>
+<a name="id4759403"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.requirements">Requirements</a>
</h5>
<p>
@@ -144,7 +144,7 @@
</dl>
</div>
<a name="boost_chrono.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_chrono__emphasis__"></a><h5>
-<a name="id4819759"></a>
+<a name="id4759659"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.building_an_executable_that_uses__emphasis_role__bold__boost_chrono__emphasis__">Building
an executable that uses <span class="bold"><strong>Boost.Chrono</strong></span>
</a>
@@ -154,7 +154,7 @@
with the Boost System library.
</p>
<a name="boost_chrono.users_guide.getting_started.install.exceptions_safety_"></a><h5>
-<a name="id4819795"></a>
+<a name="id4759693"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.exceptions_safety_">Exceptions
safety </a>
</h5>
@@ -163,7 +163,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="id4819822"></a>
+<a name="id4759721"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.thread_safety_">Thread
safety </a>
</h5>
@@ -171,7 +171,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="id4819846"></a>
+<a name="id4759746"></a>
<a href="getting_started.html#boost_chrono.users_guide.getting_started.install.tested_compilers_">Tested
compilers </a>
</h5>
@@ -260,7 +260,8 @@
<span class="comment">// add this in the scope you want to time,
</span><span class="comment">// at the point you want the timer to start.
-</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><></span> <span class="identifier">rt</span><span class="special">;</span>
+</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">rt</span><span class="special">;</span>
</pre>
<p>
Here is a complete program (stopclock_example.cpp):
@@ -270,7 +271,8 @@
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">stopclock</span><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><a href="../reference/reporters.html#boost_chrono.reference.reporters.stopclock_hpp.stopclock" title="
+ Template Class stopclock<>"><code class="computeroutput"><span class="identifier">stopclock</span></code></a><span class="special"><></span> <span class="identifier">t</span><span class="special">;</span>
<span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">10000000</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
Modified: sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html
==============================================================================
--- sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html (original)
+++ sandbox/chrono/libs/chrono/doc/html/boost_chrono/users_guide/tutorial.html 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -29,17 +29,52 @@
<div class="toc"><dl>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type">Common
Type</a></span></dt>
-<dd><dl><dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.how_to_get_the_common_type_of_inter_type_with_explicit_conversions_">How
- to get the common type of inter-type with explicit conversions?</a></span></dt></dl></dd>
+<dd><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.so_what_is__common_type__and_how_can_i_use_it_">So
+ What is <code class="computeroutput"><span class="identifier">common_type</span></code> and
+ How can I use it?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.how_to_get_the_common_type_of_inter_type_with_explicit_conversions_">How
+ to get the common type of inter-type with explicit conversions?</a></span></dt>
+</dl></dd>
<dt><span class="section">Ratio</span></dt>
-<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.clocks__time_point_and_duration">Clocks,
- time_point and duration</a></span></dt>
-<dd><dl><dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.clocks__time_point_and_duration.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_">How
+<dt><span class="section">Duration</span></dt>
+<dd><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.so_what_exactly_is_a__duration__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></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__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 <code class="computeroutput"><span class="identifier">minutes</span></code> instead of
+ <code class="computeroutput"><span class="identifier">microseconds</span></code>?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.i_m_trafficking_in_floating_point__duration_s__i_don_t_want_to_deal_with_writing__duration_cast__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>
+ all over the place. I'm content with the precision of my floating point
+ representation</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.how_expensive_is_all_of_this_">How
+ expensive is all of this?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.how_complicated_is_it_to_build_a_function_taking_a__duration__parameter_">How
+ complicated is it to build a function taking a <code class="computeroutput"><span class="identifier">duration</span></code>
+ parameter?</a></span></dt>
+</dl></dd>
+<dt><span class="section">Clocks</span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point">Time
+ Point</a></span></dt>
+<dd><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point.so_what_exactly_is_a__time_point__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></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_">How
to get the actual CPU milliseconds (or other units?) used by the current
- thread between end and start?</a></span></dt></dl></dd>
+ thread between end and start?</a></span></dt>
+</dl></dd>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks">Stopwatches
and Stopclocks</a></span></dt>
<dd><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.stopwatches_accumulation_and_statistics">Stopwatches
+ accumulation and statistics</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_">How
+ reliable are these measures?</a></span></dt>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_">How
can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
function signature?</a></span></dt>
@@ -56,24 +91,85 @@
<dd><dl><dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.formatters.how_can_i_make_a_specific_formatter_when_the_default_do_not_satisfy_my_expectations">How
can I make a specific formatter when the default do not satisfy my expectations</a></span></dt></dl></dd>
</dl></div>
-<div class="note"><table border="0" summary="Note">
-<tr>
-<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
-<th align="left">Note</th>
-</tr>
-<tr><td align="left" valign="top"><p>
- If you have not read yet the <a href="../overview/motivation.html" target="_top">motivation
- section</a>, please read it now.
- </p></td></tr>
-</table></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_chrono.users_guide.tutorial.common_type"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type" title="Common
Type">Common
Type</a>
</h4></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.how_to_get_the_common_type_of_inter_type_with_explicit_conversions_">How
- to get the common type of inter-type with explicit conversions?</a></span></dt></dl></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.so_what_is__common_type__and_how_can_i_use_it_">So
+ What is <code class="computeroutput"><span class="identifier">common_type</span></code> and
+ How can I use it?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.how_to_get_the_common_type_of_inter_type_with_explicit_conversions_">How
+ to get the common type of inter-type with explicit conversions?</a></span></dt>
+</dl></div>
+<p>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> has been a recurring
+ theme in many places for many years. We've previously known it as promote
+ and examples of it are spread throughout boost. It has been reinvented
+ independently several times, because it is so useful.
+ </p>
+<p>
+ Andrei Alexandrescu recently pointed us at a D library: std.traits - D
+ Programming Language - Digital Mars, which became the motivation for this
+ particular name, and the variadic nature of <a href="http://www.digitalmars.com/d/2.0/phobos/std_traits.html#CommonType" target="_top">this
+ trait</a>.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.common_type.so_what_is__common_type__and_how_can_i_use_it_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.so_what_is__common_type__and_how_can_i_use_it_" title="So
+ What is common_type and
+ How can I use it?">So
+ What is <code class="computeroutput"><span class="identifier">common_type</span></code> and
+ How can I use it?</a>
+</h5></div></div></div>
+<p>
+ In a nutshell, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> is a trait that
+ takes 1 or more types, and returns a type which all of the types will
+ convert to. The default definition demands this conversion be implicit.
+ However the trait can be specialized for user-defined types which want
+ to limit their inter-type conversions to explicit, and yet still want
+ to interoperate with the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> facility.
+ </p>
+<p>
+ <span class="bold"><strong>Example:</strong></span>
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span>
+<span class="keyword">typename</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">complex</span><span class="special"><</span><span class="identifier">U</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">complex</span><span class="special"><</span><span class="identifier">U</span><span class="special">>);</span>
+</pre>
+<p>
+ In the above example, "mixed-mode" complex arithmetic is allowed.
+ The return type is described by <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a>. For example the
+ resulting type of adding a <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span></code> and <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code> might be a <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code>. Another choice for the author might
+ be:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">></span>
+<span class="identifier">complex</span><span class="special"><</span><span class="keyword">typename</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
+<span class="keyword">operator</span><span class="special">+(</span><span class="identifier">complex</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">complex</span><span class="special"><</span><span class="identifier">U</span><span class="special">>);</span>
+</pre>
+<p>
+ Here is how someone might produce a variadic comparison function:
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="special">...</span><span class="identifier">T</span><span class="special">></span>
+<span class="keyword">typename</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">T</span><span class="special">...>::</span><span class="identifier">type</span>
+<span class="identifier">min</span><span class="special">(</span><span class="identifier">T</span><span class="special">...</span> <span class="identifier">t</span><span class="special">);</span>
+</pre>
+<p>
+ This is a very useful and broadly applicable utility. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> facilities use it
+ to make multi-precision arithmetic seamless and exact.
+ </p>
+</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.users_guide.tutorial.common_type.how_to_get_the_common_type_of_inter_type_with_explicit_conversions_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.common_type.how_to_get_the_common_type_of_inter_type_with_explicit_conversions_" title="How
@@ -82,29 +178,736 @@
</h5></div></div></div>
<p>
The default definition of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> demands the conversion
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> demands the conversion
be implicit. However the trait can be specialized for user-defined types
which want to limit their inter-type conversions to explicit, and yet
still want to interoperate with the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.common_type_hpp.common_type" title="
- Class Template 'common_type<>'"><code class="computeroutput"><span class="identifier">common_type</span></code></a> facility.
+ Class Template common_type<>"><code class="computeroutput"><span class="identifier">common_type</span></code></a> facility.
</p>
</div>
</div>
-<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
<a name="boost_chrono.users_guide.tutorial.ratio"></a>Ratio
-</h4></div></div></div></div>
+</h4></div></div></div>
+<p>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is a general purpose utility
+ inspired by Walter Brown allowing one to easily and safely compute rational
+ values at compile time. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> class catches all errors
+ (such as divide by zero and overflow) at compile time. It is used in the
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> classes to efficiently
+ create units of time. It can also be used in other "quantity"
+ libraries (both std-defined and user-defined), or anywhere there is a rational
+ constant which is known at compile time. The use of this utility can greatly
+ reduce the chances of run time overflow because the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> (and any ratios resulting
+ from <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> arithmetic) are always reduced
+ to lowest terms.
+ </p>
+<p>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is a template taking two
+ intmax_ts, with the second defaulted to 1. In addition to copy constructors
+ and assignement, it only has two public members, both of which are static
+ const intmax_t. One is the numerator of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and the other is the denominator.
+ The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> is always normalized such
+ that it is expressed in lowest terms, and the denominator is always positive.
+ When the numerator is 0, the denominator is always 1.
+ </p>
+<p>
+ <span class="bold"><strong>Example:</strong></span>
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">,</span> <span class="number">3</span><span class="special">></span> <span class="identifier">five_thirds</span><span class="special">;</span> <span class="comment">// five_thirds::num == 5, five_thirds::den == 3
+</span><span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">25</span><span class="special">,</span> <span class="number">15</span><span class="special">></span> <span class="identifier">also_five_thirds</span><span class="special">;</span> <span class="comment">// also_five_thirds::num == 5, also_five_thirds::den == 3
+</span><span class="keyword">typedef</span> <span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">five_thirds</span><span class="special">,</span> <span class="identifier">also_five_thirds</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">one</span><span class="special">;</span> <span class="comment">// one::num == 1, one::den == 1
+</span></pre>
+<p>
+ This facility also includes convenience typedefs for the SI prefixes <code class="computeroutput"><span class="identifier">atto</span></code> through <code class="computeroutput"><span class="identifier">exa</span></code>
+ corresponding to their internationally recognized definitions (in terms
+ of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a>). This is a tremendous syntactic
+ convenience. It will prevent errors in specifying constants as one no longer
+ has to double count the number of zeros when trying to write million or
+ billion.
+ </p>
+<p>
+ <span class="bold"><strong>Example:</strong></span>
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">giga</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5giga</span><span class="special">;</span> <span class="comment">// _5giga::num == 5000000000, _5giga::den == 1
+</span><span class="keyword">typedef</span> <span class="identifier">ratio_multiply</span><span class="special"><</span><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">5</span><span class="special">>,</span> <span class="identifier">nano</span><span class="special">>::</span><span class="identifier">type</span> <span class="identifier">_5nano</span><span class="special">;</span> <span class="comment">// _5nano::num == 1, _5nano::den == 200000000
+</span></pre>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.users_guide.tutorial.duration"></a>Duration
+</h4></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.so_what_exactly_is_a__duration__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></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__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 <code class="computeroutput"><span class="identifier">minutes</span></code> instead of
+ <code class="computeroutput"><span class="identifier">microseconds</span></code>?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.i_m_trafficking_in_floating_point__duration_s__i_don_t_want_to_deal_with_writing__duration_cast__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>
+ all over the place. I'm content with the precision of my floating point
+ representation</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.how_expensive_is_all_of_this_">How
+ expensive is all of this?</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.how_complicated_is_it_to_build_a_function_taking_a__duration__parameter_">How
+ complicated is it to build a function taking a <code class="computeroutput"><span class="identifier">duration</span></code>
+ parameter?</a></span></dt>
+</dl></div>
+<p>
+ The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is the heart of this
+ library. The interface that the user will see in everyday use is nearly
+ identical to that of Boost.DateTime time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> authored by Jeff Garland,
+ both in syntax and in behavior. This has been a very popular boost library
+ for 7 years. There is an enormous positive history with this interface.
+ </p>
+<p>
+ The library consists of six units of time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">hours</span></code></a></li>
+<li><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a></li>
+<li><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a></li>
+<li><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a></li>
+<li><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a></li>
+<li><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a></li>
+</ul></div>
+<p>
+ These units were chosen as a subset of the boost library because they are
+ the most common units used when sleeping, waiting on a condition variable,
+ or waiting to obtain the lock on a mutex. Each of these units is nothing
+ but a thin wrapper around a signed integral count. That is, when you construct
+ <code class="computeroutput"><span class="identifier">minutes</span><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>, all that
+ happens is a <code class="computeroutput"><span class="number">3</span></code> is stored inside
+ of minutes. When you construct <code class="computeroutput"><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">)</span></code>,
+ all that happens is a <code class="computeroutput"><span class="number">3</span></code> is
+ stored inside of microseconds.
+ </p>
+<p>
+ 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, <code class="computeroutput"><span class="identifier">microseconds</span></code>
+ can always represent any value <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a> has.
+ </p>
+<p>
+ In Boost.DateTime, these units are united via inheritance. <span class="bold"><strong>Boost.Chrono</strong></span>
+ instead unites these units through the class template <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. That is, in <span class="bold"><strong>Boost.Chrono</strong></span> all six of the above units are nothing
+ but typedefs to different instantiations of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. 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
+ generate any unit, any precision it needs. This is sometimes necessary
+ when doing comparisons or arithmetic between <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> of differing precision,
+ assuming one wants the comparison and arithmetic to be exactly correct.
+ </p>
+<p>
+ A secondary benefit is that by publishing the class template <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> interface, user code
+ can very easily create <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> with any precision they
+ desire. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> utility is used to specify
+ the precision, so as long as the precision can be expressed by a rational
+ constant with respect to seconds, this framework can exactly represent
+ it (one third of a second is no problem, and neither is one third of a
+ <code class="computeroutput"><span class="identifier">femto</span></code> second). All of this
+ utility and flexibility comes at no cost just by making use of the no-run-time-overhead
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> facility.
+ </p>
+<p>
+ In Boost.DateTime, <code class="computeroutput"><span class="identifier">hours</span></code>
+ does not have the same representation as <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a>. The former is usually
+ represented with a <code class="computeroutput"><span class="keyword">long</span></code> whereas
+ a <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">long</span></code>
+ 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.
+ </p>
+<p>
+ <span class="bold"><strong>Boost.Chrono</strong></span> continues, and generalizes
+ that philosophy. Not only can one specify the precision of a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, 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. <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> needs 64 bits to cover
+ that range. <code class="computeroutput"><span class="identifier">hours</span></code> needs
+ only 23 bits to cover that range.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.duration.so_what_exactly_is_a__duration__and_how_do_i_use_one_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.so_what_exactly_is_a__duration__and_how_do_i_use_one_" title="So
+ What Exactly is a duration
+ 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>
+</h5></div></div></div>
+<p>
+ A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> has a representation
+ and a tick period (precision).
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</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">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="keyword">class</span> <span class="identifier">duration</span><span class="special">;</span>
+</pre>
+<p>
+ The representation is simply any arithmetic type, or an emulation of
+ such a type. The representation stores a count of ticks. This count is
+ the only data member stored in a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. If the representation
+ is floating point, it can store fractions of a tick to the precision
+ of the representation. The tick period is represented by a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> and is encoded into the
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>'s type, instead of
+ stored. The tick period only has an impact on the behavior of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> when a conversion between
+ different <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>'s is attempted. The
+ tick period is completely ignored when simply doing arithmetic among
+ like <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>.
+ </p>
+<p>
+ <span class="bold"><strong>Example:</strong></span>
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span><span class="special">,</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span>
+<span class="identifier">minutes</span> <span class="identifier">m1</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// m1 stores 3
+</span><span class="identifier">minutes</span> <span class="identifier">m2</span><span class="special">(</span><span class="number">2</span><span class="special">);</span> <span class="comment">// m2 stores 2
+</span><span class="identifier">minutes</span> <span class="identifier">m3</span> <span class="special">=</span> <span class="identifier">m1</span> <span class="special">+</span> <span class="identifier">m2</span><span class="special">;</span> <span class="comment">// m3 stores 5
+</span>
+<span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span>
+<span class="identifier">microseconds</span> <span class="identifier">us1</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// us1 stores 3
+</span><span class="identifier">microseconds</span> <span class="identifier">us2</span><span class="special">(</span><span class="number">2</span><span class="special">);</span> <span class="comment">// us2 stores 2
+</span><span class="identifier">microseconds</span> <span class="identifier">us3</span> <span class="special">=</span> <span class="identifier">us1</span> <span class="special">+</span> <span class="identifier">us2</span><span class="special">;</span> <span class="comment">// us3 stores 5
+</span>
+<span class="identifier">microseconds</span> <span class="identifier">us4</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">// us4 stores 300000005
+</span></pre>
+<p>
+ In the final line of code above, there is an implicit conversion from
+ minutes to microseconds, resulting in a relatively large number of microseconds.
+ </p>
+<p>
+ If you need to access the tick count within a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, there is a member
+ <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span></code>
+ which simply returns the stored tick count.
+ </p>
+<pre class="programlisting"><span class="keyword">long</span> <span class="keyword">long</span> <span class="identifier">tc</span> <span class="special">=</span> <span class="identifier">us4</span><span class="special">.</span><span class="identifier">count</span><span class="special">();</span> <span class="comment">// tc is 300000005
+</span></pre>
+<p>
+ These <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> have very simple,
+ very predictable, and very observable behavior. After all, this is really
+ nothing but the time tested interface of Jeff's boost time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> library (unified with
+ templates instead of inheritance).
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__to__minutes__instead_of__microseconds__"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__to__minutes__instead_of__microseconds__" title="What
+ happens if I assign m3 + us3
+ 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 <code class="computeroutput"><span class="identifier">minutes</span></code> instead of
+ <code class="computeroutput"><span class="identifier">microseconds</span></code>?</a>
+</h5></div></div></div>
+<pre class="programlisting"><span class="identifier">minutes</span> <span class="identifier">m4</span> <span class="special">=</span> <span class="identifier">m3</span> <span class="special">+</span> <span class="identifier">us3</span><span class="special">;</span>
+</pre>
+<p>
+ It won't compile. The rationale is that implicit truncation error should
+ not be allowed to happen. If this were to compile, then <code class="computeroutput"><span class="identifier">m4</span></code> would hold <code class="computeroutput"><span class="number">5</span></code>,
+ the same value as <code class="computeroutput"><span class="identifier">m3</span></code>.
+ The value associated with <code class="computeroutput"><span class="identifier">us3</span></code>
+ has been effectively 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.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__to__minutes__instead_of__microseconds__.but_what_if_the_truncation_behavior_is_what_i_want_to_do_"></a><h6>
+<a name="id4816093"></a>
+ <a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.what_happens_if_i_assign__m3___us3__to__minutes__instead_of__microseconds__.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>
+ </h6>
+<p>
+ There is a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> facility to explicitly
+ ask for this behavior:
+ </p>
+<pre class="programlisting"><span class="identifier">minutes</span> <span class="identifier">m4</span> <span class="special">=</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">minutes</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">// m4.count() == 5
+</span></pre>
+<p>
+ In general, one can perform <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arithmetic at will.
+ If <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> isn't used, and
+ it compiles, the arithmetic is exact. Any place one wants to override
+ this exact arithmetic behavior, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> can be used to
+ explicitly specify that desire. The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a> has the same efficiency
+ as the implicit conversion, and will even be exact as often as it can.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.duration.i_m_trafficking_in_floating_point__duration_s__i_don_t_want_to_deal_with_writing__duration_cast__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.i_m_trafficking_in_floating_point__duration_s__i_don_t_want_to_deal_with_writing__duration_cast__all_over_the_place__i_m_content_with_the_precision_of_my_floating_point_representation" title="I'm
+ trafficking in floating point durations.
+ I don't want to deal with writing duration_cast
+ 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>
+ all over the place. I'm content with the precision of my floating point
+ representation</a>
+</h5></div></div></div>
+<p>
+ Not a problem. When the destination of a conversion has floating point
+ representation, all conversions are allowed to happen implicitly.
+ </p>
+<pre class="programlisting"><span class="keyword">typedef</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">dminutes</span><span class="special">;</span>
+<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>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.duration.how_expensive_is_all_of_this_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.how_expensive_is_all_of_this_" title="How
+ expensive is all of this?">How
+ expensive is all of this?</a>
+</h5></div></div></div>
+<p>
+ If you were writing these conversions by hand, you could not make it
+ more efficient. The use of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> ensures that all conversion
+ constants are simplified as much as possible at compile time. This usually
+ results in the numerator or denominator of the conversion factor simplifying
+ to <code class="computeroutput"><span class="number">1</span></code>, and being subsequently
+ ignored in converting the run time values of the tick counts.
+ </p>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.duration.how_complicated_is_it_to_build_a_function_taking_a__duration__parameter_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.duration.how_complicated_is_it_to_build_a_function_taking_a__duration__parameter_" title="How
+ complicated is it to build a function taking a duration
+ parameter?">How
+ complicated is it to build a function taking a <code class="computeroutput"><span class="identifier">duration</span></code>
+ parameter?</a>
+</h5></div></div></div>
+<p>
+ There are several options open to the user:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ If the author of the function wants to accept any <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, and is willing to
+ work in floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>, he can simply use
+ any floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> as the parameter:
+ </li></ul></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span> <span class="comment">// accept floating point seconds
+</span><span class="special">{</span>
+ <span class="comment">// d.count() == 3.e-6 when passed microseconds(3)
+</span><span class="special">}</span>
+
+<span class="identifier">f</span><span class="special">(</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+</pre>
+<div class="itemizedlist"><ul type="disc"><li>
+ If the author of the function wants to traffic only in integral <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>, and is content
+ with handling nothing finer than say nanoseconds (just as an example),
+ he can simply specify nanoseconds as the parameter:
+ </li></ul></div>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">nanoseconds</span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="comment">// d.count() == 3000 when passed microseconds(3)
+</span><span class="special">}</span>
+
+<span class="identifier">f</span><span class="special">(</span><span class="identifier">microseconds</span><span class="special">(</span><span class="number">3</span><span class="special">));</span>
+</pre>
+<p>
+ In this design, if the client wants to pass in a floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, or a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> of finer precision
+ than nanoseconds, then the client is responsible for choosing his own
+ rounding mode in the conversion to nanoseconds.
+ </p>
+<pre class="programlisting"> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">s</span><span class="special">(</span><span class="number">1.</span><span class="special">/</span><span class="number">3</span><span class="special">);</span> <span class="comment">// 1/3 of a second
+</span><span class="identifier">f</span><span class="special">(</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">>(</span><span class="identifier">s</span><span class="special">));</span> <span class="comment">// round towards zero in conversion to nanoseconds
+</span></pre>
+<p>
+ In the example above, the client of f has chosen "round towards
+ zero" as the desired rounding mode to nanoseconds. If the client
+ has a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> that won't exactly
+ convert to nanoseconds, and fails to choose how the conversion will take
+ place, the compiler will refuse the call:
+ </p>
+<pre class="programlisting"><span class="identifier">f</span><span class="special">(</span><span class="identifier">s</span><span class="special">);</span> <span class="comment">// does not compile
+</span></pre>
+<div class="itemizedlist"><ul type="disc"><li>
+ If the author of the function wants to accept any <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, but wants to work
+ with integral representations and wants to control the rounding mode
+ internally, then he can template the function:
+ </li></ul></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</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">></span>
+<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="comment">// convert d to nanoseconds, rounding up if it is not an exact conversion
+</span> <span class="identifier">nanoseconds</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ns</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">++</span><span class="identifier">ns</span><span class="special">;</span>
+ <span class="comment">// ns.count() == 333333334 when passed 1/3 of a floating point second
+</span><span class="special">}</span>
+
+<span class="identifier">f</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="number">1.</span><span class="special">/</span><span class="number">3</span><span class="special">));</span>
+</pre>
+<div class="itemizedlist"><ul type="disc"><li>
+ If the author in the example does not want to accept floating point
+ based <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a>, he can enforce
+ that behavior like so:
+ </li></ul></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
+<span class="keyword">void</span> <span class="identifier">f</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="comment">// convert d to nanoseconds, rounding up if it is not an exact conversion
+</span> <span class="identifier">nanoseconds</span> <span class="identifier">ns</span> <span class="special">=</span> <span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
+ <span class="keyword">if</span> <span class="special">(</span><span class="identifier">ns</span> <span class="special"><</span> <span class="identifier">d</span><span class="special">)</span>
+ <span class="special">++</span><span class="identifier">ns</span><span class="special">;</span>
+ <span class="comment">// ns.count() == 333333334 when passed 333333333333 picoseconds
+</span><span class="special">}</span>
+
+<span class="identifier">f</span><span class="special">(</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">pico</span><span class="special">>(</span><span class="number">333333333333</span><span class="special">));</span> <span class="comment">// About 1/3 of a second worth of picoseconds
+</span></pre>
+<p>
+ Clients with floating point <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> who want to use f
+ will now have to convert to an integral <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> themselves before passing
+ the result to f.
+ </p>
+<p>
+ In summary, the author of f has quite a bit of flexibility and control
+ in the interface he wants to provide his clients with, and easy options
+ for manipulating that <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> internal to his function.
+ </p>
+</div>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_chrono.users_guide.tutorial.clocks"></a>Clocks
+</h4></div></div></div>
+<p>
+ While <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code>s</a> only have precision
+ and representation to concern themselves, clocks and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> are intimately related
+ and refer to one another. Because clocks are simpler to explain, we will
+ do so first without fully explaining <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a>. Once clocks are introduced,
+ it will be easier to then fill in what a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> is.
+ </p>
+<p>
+ A clock is a concept which bundles 3 things:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ A concrete <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> type.
+ </li>
+<li>
+ A concrete <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> type.
+ </li>
+<li>
+ A function called now() which returns the concrete <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>.
+ </li>
+</ol></div>
+<p>
+ <span class="bold"><strong>Boost.Chrono</strong></span> provides the standard concrete
+ clocks:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ system_clock
+ </li>
+<li>
+ monotonic_clock
+ </li>
+<li>
+ high_precision_clock
+ </li>
+</ol></div>
+<p>
+ A given platform may not be able to supply all three of these clocks. The
+ user is also able to easily create more clocks.
+ </p>
+<p>
+ Given a clock named Clock, it will have:
+ </p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">Clock</span> <span class="special">{</span>
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="keyword">typedef</span> <span class="identifier">an</span> <span class="identifier">arithmetic</span><span class="special">-</span><span class="identifier">like</span> <span class="identifier">type</span> <span class="identifier">rep</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">an</span> <span class="identifier">instantiation</span> <span class="identifier">of</span> <span class="identifier">ratio</span> <span class="identifier">period</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">,</span> <span class="identifier">period</span><span class="special">></span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
+ <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_monotonic</span> <span class="special">=</span> <span class="keyword">true</span> <span class="keyword">or</span> <span class="keyword">false</span><span class="special">;</span>
+
+ <span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">();</span>
+<span class="special">};</span>
+</pre>
+<p>
+ One can get the current time from Clock with:
+ </p>
+<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">t1</span> <span class="special">=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+</pre>
+<p>
+ And one can get the time <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> between two <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> associated with Clock
+ with:
+ </p>
+<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">t1</span> <span class="special">-</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+</pre>
+<p>
+ And one can specify a past or future <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> with:
+ </p>
+<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">t2</span> <span class="special">=</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">d</span><span class="special">;</span>
+</pre>
+<p>
+ Note how even if a particular clock becomes obsolete, the next clock in
+ line will have the same API. There is no new learning curve to come up.
+ The only source code changes will be simply changing the type of the clock.
+ The same <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> framework continues
+ to work as new clocks are introduced. And multiple clocks are safely and
+ easily handled within the same program.
+ </p>
+</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
-<a name="boost_chrono.users_guide.tutorial.clocks__time_point_and_duration"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.clocks__time_point_and_duration" title="Clocks,
- time_point and duration">Clocks,
- time_point and duration</a>
+<a name="boost_chrono.users_guide.tutorial.time_point"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point" title="Time
+ Point">Time
+ Point</a>
</h4></div></div></div>
-<div class="toc"><dl><dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.clocks__time_point_and_duration.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_">How
+<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point.so_what_exactly_is_a__time_point__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></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_">How
to get the actual CPU milliseconds (or other units?) used by the current
- thread between end and start?</a></span></dt></dl></div>
+ thread between end and start?</a></span></dt>
+</dl></div>
+<p>
+ A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents a point
+ in time, as opposed to a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> of time. Another way
+ of saying the same thing, is that a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents an epoch
+ plus or minus a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. Examples of <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> include:
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ 3 minutes after the computer booted.
+ </li>
+<li>
+ 03:14:07 UTC on Tuesday, January 19, 2038
+ </li>
+<li>
+ 20 milliseconds after I started that timer.
+ </li>
+</ul></div>
+<p>
+ 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 <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> are known to share
+ the same epoch, they can be subtracted, yielding a valid <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, even if the definition
+ of the epoch no longer has meaning.
+ </p>
+<p>
+ In <span class="bold"><strong>Boost.Chrono</strong></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) <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> to a clock, and in
+ the case that they share a clock, <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> to one another. <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> associated with different
+ clocks are generally not interoperable unless the relationship between
+ the epochs associated with each clock is known.
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.time_point.so_what_exactly_is_a__time_point__and_how_do_i_use_one_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point.so_what_exactly_is_a__time_point__and_how_do_i_use_one_" title="So
+ What Exactly is a time_point
+ 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>
+</h5></div></div></div>
+<p>
+ A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> has a clock and a
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span> <span class="keyword">class</span> <span class="identifier">time_point</span><span class="special">;</span>
+</pre>
+<p>
+ The <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>'s clock is not stored.
+ It is simply embedded into the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>'s type and serves
+ two purposes:
+ </p>
+<div class="orderedlist"><ol type="1">
+<li>
+ Because <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> originating from
+ different clocks have different types, the compiler can be instructed
+ to fail if incompatible <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> are used in inappropriate
+ ways.
+ </li>
+<li>
+ Given a <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>, one often needs
+ to compare that <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> to "now".
+ This is very simple as long as the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> knows what clock
+ it is defined with respect to.
+ </li>
+</ol></div>
+<p>
+ A <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>'s <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is stored as the only
+ data member of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>. Thus <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> and their corresponding
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> have exactly the same
+ layout. But they have very different meanings. For example, it is one
+ thing to say I want to sleep for 3 minutes. It is a completely different
+ thing to say I want to sleep until 3 minutes past the time I started
+ that timer (unless you just happened to start that timer now). Both meanings
+ (and options for sleeping) have great practical value in common use cases
+ for sleeping, waiting on a condition variable, and waiting for a mutex's
+ lock. These same concepts and tools are found (for example) in Ada.
+ </p>
+<p>
+ A timer example:
+ </p>
+<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">f</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">start</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">();</span>
+ <span class="identifier">g</span><span class="special">();</span>
+ <span class="identifier">h</span><span class="special">();</span>
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">sec</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">;</span>
+ <span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"f() took "</span> <span class="special"><<</span> <span class="identifier">sec</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">" seconds\n"</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Note that if one is using the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> between two clock
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.time_point" title="
+ Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code>s</a> in a way where the
+ precision of the <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> matters, it is good
+ practice to convert the clock's native <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> to a known <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. This insulates the
+ code from future changes which may be made to the clock's native precision
+ in the future. For example monotonic_clock could easily be based on the
+ clock speed of the cpu. When you upgrade to a faster machine, you do
+ not want your code that assumed a certain tick period of this clock to
+ start experiencing run time failures because your timing code has silently
+ changed meaning.
+ </p>
+<p>
+ A delay loop example:
+ </p>
+<pre class="programlisting"><span class="comment">// delay for at least 500 nanoseconds:
+</span><span class="keyword">auto</span> <span class="identifier">go</span> <span class="special">=</span> <span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">nanoseconds</span><span class="special">(</span><span class="number">500</span><span class="special">);</span>
+<span class="keyword">while</span> <span class="special">(</span><span class="identifier">monotonic_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span> <span class="special"><</span> <span class="identifier">go</span><span class="special">)</span>
+ <span class="special">;</span>
+</pre>
+<p>
+ The above code will delay as close as possible to half a microsecond,
+ no matter what the precision of monotonic_clock is. The more precise
+ <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.monotonic_clock" title="
+ Class monotonic_clock"><code class="computeroutput"><span class="identifier">monotonic_clock</span></code></a> becomes, the
+ more accurate will be the delay to 500 nanoseconds.
+ </p>
+</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
-<a name="boost_chrono.users_guide.tutorial.clocks__time_point_and_duration.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.clocks__time_point_and_duration.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_" title="How
+<a name="boost_chrono.users_guide.tutorial.time_point.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.time_point.how_to_get_the_actual_cpu_milliseconds__or_other_units___used_by_the_current_thread_between_end_and_start_" title="How
to get the actual CPU milliseconds (or other units?) used by the current
thread between end and start?">How
to get the actual CPU milliseconds (or other units?) used by the current
@@ -112,10 +915,10 @@
</h5></div></div></div>
<p>
You can use <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><> to convert
- the <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code> into whatever units you desire.
- This facility will round down (truncate) if an exact conversion is not
- possible. Ex:
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ to convert the <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code>
+ into whatever units you desire. This facility will round down (truncate)
+ if an exact conversion is not possible. Ex:
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">milliseconds</span> <span class="identifier">ms</span><span class="special">;</span>
<span class="identifier">ms</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ms</span><span class="special">>(</span><span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">);</span>
@@ -126,10 +929,13 @@
</pre>
<p>
As <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code> is nanoseconds, we can convert
- to <code class="computeroutput"><span class="identifier">nanoseconds</span></code>, or some
- integral-based duration which <code class="computeroutput"><span class="identifier">nanoseconds</span></code>
- will always exactly convert to, then <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><> is unnecessary:
+ to <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a>, or some integral-based
+ duration which <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_typedefs" title="
+ duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> will always exactly
+ convert to, then <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ is unnecessary:
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">nanoseconds</span> <span class="identifier">ns</span><span class="special">;</span>
<span class="identifier">ns</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">;</span>
@@ -137,18 +943,19 @@
</pre>
<p>
If you need seconds with a floating point representation you can also
- eliminate the __duration<span class="underline">cast</span><>:
+ eliminate the __duration<span class="underline">cast</span><code class="computeroutput"><span class="special"><></span></code>:
</p>
-<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">sec</span><span class="special">;</span> <span class="comment">// seconds, stored with a double
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">sec</span><span class="special">;</span> <span class="comment">// seconds, stored with a double
</span><span class="identifier">sec</span> <span class="identifier">d</span> <span class="special">=</span> <span class="identifier">end</span> <span class="special">-</span> <span class="identifier">start</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">sec</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span> <span class="special"><<</span> <span class="string">"s\n"</span><span class="special">;</span>
</pre>
<p>
If you're not sure if you need <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><> or not,
- feel free to try it without. If the conversion is exact, or if the destination
- has a floating point representation, it will compile. Else it will not
- compile.
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ or not, feel free to try it without. If the conversion is exact, or if
+ the destination has a floating point representation, it will compile.
+ Else it will not compile.
</p>
<p>
If you would like to programmatically inspect <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">duration</span></code>,
@@ -156,21 +963,23 @@
and the tick period with <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">period</span></code>
(which should be a type <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a> which has nested values
- <code class="computeroutput"><span class="identifier">ratio</span><span class="special">::</span><span class="identifier">num</span></code> and <code class="computeroutput"><span class="identifier">ratio</span><span class="special">::</span><span class="identifier">den</span></code>).
- The tick period of <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ <code class="computeroutput"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">::</span><span class="identifier">num</span></code> and <code class="computeroutput"><a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.ratio_hpp.ratio" title=" Class
+ Template ratio<>"><code class="computeroutput"><span class="identifier">ratio</span></code></a><span class="special">::</span><span class="identifier">den</span></code>). The tick period of <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> is <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">period</span><span class="special">::</span><span class="identifier">num</span> <span class="special">/</span> <span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">period</span><span class="special">::</span><span class="identifier">den</span></code> seconds: 1/1000000000 in this case
(1 billionth of a second), stored in a long long.
</p>
<p>
If you need to use <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration_cast" title="
- Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><>, but want
- to round up, instead of down when the conversion is inexact, here is
- a handy little helper function to do so. Writing it is actually a good
- starter project for understanding chrono:
+ Non-Member function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><code class="computeroutput"><span class="special"><></span></code>,
+ but want to round up, instead of down when the conversion is inexact,
+ here is a handy little helper function to do so. Writing it is actually
+ a good starter project for understanding chrono:
</p>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</span><span class="special">,</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
<span class="identifier">ToDuration</span>
-<span class="identifier">round_up</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
+<span class="identifier">round_up</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">d</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">// first round down
</span> <span class="identifier">ToDuration</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration_cast</span><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">d</span><span class="special">);</span>
@@ -193,6 +1002,10 @@
and Stopclocks</a>
</h4></div></div></div>
<div class="toc"><dl>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.stopwatches_accumulation_and_statistics">Stopwatches
+ accumulation and statistics</a></span></dt>
+<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_">How
+ reliable are these measures?</a></span></dt>
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_">How
can I prefix each report with <code class="computeroutput"><span class="identifier">BOOST_CURRENT_FUNCTION</span></code>
function signature?</a></span></dt>
@@ -205,6 +1018,194 @@
<dt><span class="section"><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_to_get_specific_statistics_from_stopwatches_accumulator_">How
to get specific statistics from stopwatches accumulator?</a></span></dt>
</dl></div>
+<p>
+ Knowing how long a program, a function or a specific block takes to execute
+ is useful in both test and production environments. <span class="bold"><strong>Boost.Chrono</strong></span>
+ introduces the <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
+ Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> concept which captures
+ the mechanism to measure the elapsed time. A Stopwatch allows to start,
+ stop, suspend and resume the measure of the eleapsed time. <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a><code class="computeroutput"><span class="special"><></span></code>
+ is the basic model of <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_req" title="
+ Stopwatch Requirements"><code class="computeroutput"><span class="identifier">Stopwatch</span></code></a> allowing to make a single
+ measure.
+ </p>
+<p>
+ At the user level, the main use case of measuring the elapsed time is to
+ report these measures on the display. <a href="../reference/reporters.html#boost_chrono.reference.reporters.stopwatch_reporter_hpp.stopwatch_reporter" title="
+ Template Class stopwatch_reporter<>"><code class="computeroutput"><span class="identifier">stopwatch_reporter</span></code></a><code class="computeroutput"><span class="special"><></span></code> provides a run time reporting package
+ that can be invoked in a single line of code to report the usage of a Clock.
+ For example
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
+ <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch</span><span class="special"><></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">100000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">200000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">300000</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Will produce the following output
+ </p>
+<pre class="programlisting"><span class="number">0.006</span><span class="identifier">s</span>
+<span class="number">0.011</span><span class="identifier">s</span>
+<span class="number">0.017</span><span class="identifier">s</span>
+</pre>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.stopwatches_accumulation_and_statistics"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.stopwatches_accumulation_and_statistics" title="Stopwatches
+ accumulation and statistics">Stopwatches
+ accumulation and statistics</a>
+</h5></div></div></div>
+<p>
+ The preceding stopwatch manage only with a measure. It is also interesting
+ to have an statisitical view of these times, for example the sum, min,
+ max and mean. <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_accumulator_hpp.stopwatch_accumulator" title="
+ Template Class stopwatch_accumulator<>"><code class="computeroutput"><span class="identifier">stopwatch_accumulator</span></code></a><code class="computeroutput"><span class="special"><></span></code> associates an accumulator with
+ a <a href="../reference/stopwatches.html#boost_chrono.reference.stopwatches.stopwatch_hpp.stopwatch" title="
+ Template Class stopwatch<>"><code class="computeroutput"><span class="identifier">stopwatch</span></code></a>, so we are able to
+ retrieve any statistical feature Boost.Accumulator provides.
+ </p>
+<p>
+ For example
+ </p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">;</span>
+<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">long</span> <span class="identifier">j</span><span class="special">)</span> <span class="special">{</span>
+ <span class="keyword">static</span> <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">></span> <span class="identifier">sw</span><span class="special">;</span>
+ <span class="identifier">stopwatch_reporter</span><span class="special"><</span><span class="identifier">stopwatch_accumulator</span><span class="special"><></span> <span class="special">>::</span><span class="identifier">scoped_run</span> <span class="identifier">_</span><span class="special">(</span><span class="identifier">sw</span><span class="special">);</span>
+
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">long</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="identifier">j</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">sqrt</span><span class="special">(</span> <span class="number">123.456L</span> <span class="special">);</span> <span class="comment">// burn some time
+</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> <span class="special">{</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">100000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">200000</span><span class="special">);</span>
+ <span class="identifier">f1</span><span class="special">(</span><span class="number">300000</span><span class="special">);</span>
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ Will produce the following output
+ </p>
+<pre class="programlisting"><span class="number">3</span> <span class="identifier">times</span><span class="special">,</span> <span class="identifier">sum</span><span class="special">=</span><span class="number">0.034</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">min</span><span class="special">=</span><span class="number">0.006</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">max</span><span class="special">=</span><span class="number">0.017</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">mean</span><span class="special">=</span><span class="number">0.011</span><span class="identifier">s</span>
+</pre>
+</div>
+<p>
+ [
+ </p>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_reliable_are_these_measures_" title="How
+ reliable are these measures?">How
+ reliable are these measures?</a>
+</h5></div></div></div>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ this section need to be reworked, the ideas are there, but ...
+ </p></td></tr>
+</table></div>
+<p>
+ There are three context on which you can get unreliable measures:
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ Precission of your clock. If the precission of your clock is 10ms you
+ can not be able to measure the time spent by blocks of code that takes
+ the same order of magnitude. The library provides a hig_resolution_clock
+ that gives you the higher resolution available on your platform. Respect
+ to the precission, nothing to do except to take the clock with the
+ highest resolution and measures blocks of code that will spent time
+ having more than one order of magnitude the precission of the clock.
+ </li></ul></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+ <span class="special">...</span>
+ <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">high_resolution_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ When your application is multithreaded, and you use a process clock,
+ the time you get is the delay during which your block has been executed,
+ in concurrency with the other threads of execution. If what you want
+ is the time spent by this specific thread another clock is needed.
+ The library provide a <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="
+ Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> that returns
+ the time spent by the thread on platforms providing this kind of data.
+ It can be used as follows
+ </li></ul></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">thread_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+<span class="special">...</span>
+<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
+ <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+<span class="preprocessor">#else</span>
+ <span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+<span class="preprocessor">#endif</span>
+</pre>
+<p>
+ </p>
+<div class="itemizedlist"><ul type="disc"><li>
+ Nested stopclocks (usually nested function calls where each function
+ contains a stopclock). When the nesting is deep enough, the cumulative
+ overhead of all the stopclock functionality make the data unreliable
+ except for the inner-most trace points. The question is, how much time
+ is related to the application code we want to measure and how much
+ to the fact we are meassuring and logging in inner blocks?
+ </li></ul></div>
+<p>
+ Some measures let us think that most of the time spent by the stopclock
+ mechanism is associated to the logging part. There are two things we
+ can do to make the difference :
+ </p>
+<div class="itemizedlist"><ul type="disc">
+<li>
+ Avoid expensive operations as logging while doing the measures. Note
+ that reporting in itself is not too expensive as far as we don't need
+ to flush the buffer. This can be achieved either using a stopclock
+ accumulator, 'i.e. don't report until all the measures have been compiled
+ and then report some statistics or using an asynchronous stream.
+ </li>
+<li>
+ Introduce some cheap mechanism that allows us to make the difference
+ between the application time and the intrinsec stopclock time. When
+ the precission of the clock is enough, we can suspend the counting
+ of the Clock while we are spending time reporting the measures, and
+ resume it once the work is done. The library provide a Clock wrapper
+ <a href="../reference/other_clocks.html#boost_chrono.reference.other_clocks.suspendible_clock_hpp.suspendible_clock" title="
+ Template Class suspendible_clock<>"><code class="computeroutput"><span class="identifier">suspendible_clock</span></code></a> that make
+ the resulting clock suspendible. The stopwatch_reporter is able to
+ detect if the CLock is Suspendible and then suspend/resume the clock
+ while doing the report.
+ </li>
+</ul></div>
+<pre class="programlisting"><span class="identifier">stopclock</span><span class="special"><</span><span class="identifier">suspendible_clock</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">></span> <span class="special">></span> <span class="identifier">_</span><span class="special">;</span>
+</pre>
+<p>
+ See the performances section for more deep details.
+ </p>
+</div>
+<p>
+ ]
+ </p>
<div class="section" lang="en">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_"></a><a href="tutorial.html#boost_chrono.users_guide.tutorial.stopwatches_and_stopclocks.how_can_i_prefix_each_report_with__boost_current_function__function_signature_" title="How
@@ -424,7 +1425,7 @@
<p>
But what happens if we add new statistics to the accumulator_set that
are not taken in account by the default formatter? These statistics will
- simply be ignored. So we will need to define own own accumulator formatter.
+ simply be ignored. So we will need to define our own accumulator formatter.
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">stopwatch_accumulator</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span>
<span class="identifier">accumulator_set</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
@@ -478,7 +1479,8 @@
<span class="keyword">break</span><span class="special">;</span>
<span class="keyword">case</span> <span class="char">'a'</span><span class="special">:</span>
<span class="identifier">os</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)></span><span class="number">0</span><span class="special">)</span>
- <span class="special">?</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="identifier">duration_t</span><span class="special">(</span>
+ <span class="special">?</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="identifier">duration_t</span><span class="special">(</span>
<span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span><span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">mean</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)))).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special">:</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">break</span><span class="special">;</span>
@@ -487,7 +1489,8 @@
<span class="keyword">break</span><span class="special">;</span>
<span class="keyword">case</span> <span class="char">'v'</span><span class="special">:</span>
<span class="identifier">os</span> <span class="special"><<</span> <span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">count</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)></span><span class="number">0</span><span class="special">)</span>
- <span class="special">?</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="identifier">duration_t</span><span class="special">(</span>
+ <span class="special">?</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span> <a href="../reference/cpp0x.html#boost_chrono.reference.cpp0x.chrono_chrono_hpp.duration" title="
+ Class template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">>(</span><span class="identifier">duration_t</span><span class="special">(</span>
<span class="identifier">duration_t</span><span class="special">::</span><span class="identifier">rep</span><span class="special">(</span><span class="identifier">accumulators</span><span class="special">::</span><span class="identifier">variance</span><span class="special">(</span><span class="identifier">acc</span><span class="special">)))).</span><span class="identifier">count</span><span class="special">()</span>
<span class="special">:</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">break</span><span class="special">;</span>
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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -50,10 +50,7 @@
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="section">Overview</span></dt>
-<dd><dl>
-<dt><span class="section">Motivation</span></dt>
-<dt><span class="section"> Caveat emptor</span></dt>
-</dl></dd>
+<dd><dl><dt><span class="section">Motivation</span></dt></dl></dd>
<dt><span class="section"> Users'Guide</span></dt>
<dd><dl>
<dt><span class="section"> Getting Started</span></dt>
@@ -98,7 +95,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: July 01, 2010 at 16:08:22 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 04, 2010 at 21:52:08 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 2010-07-04 18:18:31 EDT (Sun, 04 Jul 2010)
@@ -1,7 +1,6 @@
index.html
boost_chrono/overview.html
boost_chrono/overview/motivation.html
-boost_chrono/overview/caveat.html
boost_chrono/users_guide.html
boost_chrono/users_guide/getting_started.html
boost_chrono/users_guide/tutorial.html
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