|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59249 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-01-24 03:52:58
Author: viboes
Date: 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
New Revision: 59249
URL: http://svn.boost.org/trac/boost/changeset/59249
Log:
Boost.Chrono: Version 0.3.2,
* Added overloading for operator/(Integer/Duration)
* Added frequency, lifetime and percentage to the default stopwatch_accumulator_formatter
Text files modified:
sandbox/chrono/boost/chrono/chrono.hpp | 44 +++++++
sandbox/chrono/boost/chrono/stopclock.hpp | 9
sandbox/chrono/boost/chrono/stopclock_accumulator.hpp | 11 +
sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp | 230 ++++++++++++---------------------------
sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp | 44 ++++--
sandbox/chrono/boost/chrono/stopwatch_reporter.hpp | 12 +-
sandbox/chrono/boost/chrono/suspendible_clock.hpp | 34 +++--
7 files changed, 182 insertions(+), 202 deletions(-)
Modified: sandbox/chrono/boost/chrono/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/chrono.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -152,6 +152,37 @@
};
///
+ template <class Rep, class Duration, bool = is_duration<Rep>::value>
+ struct duration_divide_result2
+ {
+ };
+
+ template <class Rep, class Duration,
+ bool = (
+ boost::is_convertible<typename Duration::rep,
+ typename common_type<typename Duration::rep, Rep>::type>::value
+ && boost::is_convertible<Rep,
+ typename common_type<typename Duration::rep, Rep>::type>::value
+ )
+ >
+ struct duration_divide_imp2
+ {
+ };
+
+ template <class Rep1, class Rep2, class Period >
+ struct duration_divide_imp2<Rep1, duration<Rep2, Period>, true>
+ {
+ //typedef typename common_type<Rep1, Rep2>::type type;
+ typedef double type;
+ };
+
+ template <class Rep1, class Rep2, class Period >
+ struct duration_divide_result2<Rep1, duration<Rep2, Period>, false>
+ : duration_divide_imp2<Rep1, duration<Rep2, Period> >
+ {
+ };
+
+///
template <class Duration, class Rep, bool = is_duration<Rep>::value>
struct duration_modulo_result
{
@@ -666,6 +697,19 @@
return CD(lhs).count() / CD(rhs).count();
}
+ template <class Rep1, class Rep2, class Period>
+ inline
+ typename boost::disable_if <boost::chrono::detail::is_duration<Rep1>,
+ typename boost::chrono::detail::duration_divide_result2<Rep1, duration<Rep2, Period> >::type
+ >::type
+ operator/(const Rep1& s, const duration<Rep2, Period>& d)
+ {
+ typedef typename common_type<Rep1, Rep2>::type CR;
+ duration<CR, Period> r = d;
+ //return static_cast<CR>(r.count()) / static_cast<CR>(s);
+ return static_cast<CR>(s)/r.count();
+ }
+
// Duration %
template <class Rep1, class Period, class Rep2>
Modified: sandbox/chrono/boost/chrono/stopclock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock.hpp (original)
+++ sandbox/chrono/boost/chrono/stopclock.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -48,7 +48,7 @@
template <class Clock, class Formatter>
struct stopwatch_reporter_default_formatter<stopclock<Clock,Formatter> > {
- typedef typename stopwatch_reporter_default_formatter<stopwatch<Clock> >::type type;
+ typedef Formatter type;
};
template <class Clock, class Formatter>
@@ -100,10 +100,11 @@
system::error_code & ec = system::throws )
: base_type(os, places, format, ec) { }
+ typedef stopwatch_runner<stopclock> scoped_run;
+ typedef stopwatch_stopper<stopclock> scoped_stop;
+ typedef stopwatch_suspender<stopclock> scoped_suspend;
+ typedef stopwatch_resumer<stopclock> scoped_resume;
- typedef typename base_type::scoped_run scoped_run;
- typedef typename base_type::scoped_suspend scoped_suspend;
- typedef typename base_type::scoped_resume scoped_resume;
};
typedef stopclock< boost::chrono::system_clock > system_stopclock;
Modified: sandbox/chrono/boost/chrono/stopclock_accumulator.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock_accumulator.hpp (original)
+++ sandbox/chrono/boost/chrono/stopclock_accumulator.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -43,13 +43,13 @@
* }
*/
//--------------------------------------------------------------------------------------//
-
+
template <class Clock=high_resolution_clock, class Formatter=typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type>
class stopclock_accumulator;
template <class Clock, class Formatter>
struct stopwatch_reporter_default_formatter<stopclock_accumulator<Clock,Formatter> > {
- typedef typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type type;
+ typedef Formatter type;
};
template <class Clock, class Formatter>
@@ -102,9 +102,10 @@
: base_type(os, places, format, ec) { }
- typedef typename base_type::scoped_run scoped_run;
- typedef typename base_type::scoped_suspend scoped_suspend;
- typedef typename base_type::scoped_resume scoped_resume;
+ typedef stopwatch_runner<stopclock_accumulator> scoped_run;
+ typedef stopwatch_stopper<stopclock_accumulator> scoped_stop;
+ typedef stopwatch_suspender<stopclock_accumulator> scoped_suspend;
+ typedef stopwatch_resumer<stopclock_accumulator> scoped_resume;
};
typedef stopclock_accumulator< boost::chrono::system_clock > system_stopclock_accumulator;
Modified: sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -25,7 +25,10 @@
#include <boost/config/abi_prefix.hpp> // must be the last #include
-namespace boost { namespace chrono {
+namespace boost
+{
+ namespace chrono
+ {
//--------------------------------------------------------------------------------------//
// stopwatch
@@ -42,106 +45,8 @@
//~ but the watch mechanism continues running to record total elapsed time.
//--------------------------------------------------------------------------------------//
-namespace kind {
-struct idle {};
-struct running {};
-struct running_and_idle {};
-}
-namespace detail {
-template <
- class Clock,
- class RunningIdleKind,
- class Accumulator
->
-struct basic_stopwatch_accumulator;
-
-template <
- class Clock,
- class Accumulator
->
-class basic_stopwatch_accumulator<Clock, kind::running, Accumulator> {
-public:
- typedef Clock clock;
- typedef typename Clock::duration duration;
- typedef typename Clock::time_point time_point;
- typedef Accumulator accumulator;
-
- accumulator& accumulated( ) { return accumulated_; }
-
-protected:
- basic_stopwatch_accumulator( )
- : running_(false), suspended_(false), accumulated_(),
- partial_(duration::zero()), start_((duration::zero())), level_(0), suspend_level_(0)
- {}
-
- void idle_on_start(time_point &) {}
- void idle_on_stop(time_point &) {}
-
- bool running_;
- bool suspended_;
- accumulator accumulated_;
- duration partial_;
- time_point start_;
- std::size_t level_;
- std::size_t suspend_level_;
-
-};
-
-
-template <
- class Clock,
- class Accumulator
->
-class basic_stopwatch_accumulator<Clock, kind::running_and_idle, Accumulator>
- : public basic_stopwatch_accumulator<Clock, kind::running, Accumulator>
-{
- typedef basic_stopwatch_accumulator<Clock, kind::running, Accumulator> base_type;
-public:
- typedef Clock clock;
- typedef typename Clock::duration duration;
- typedef typename Clock::time_point time_point;
- typedef Accumulator accumulator;
-
- accumulator& idle_accumulated( ) { return idle_accumulated_; }
-
-protected:
- basic_stopwatch_accumulator( )
- : base_type(),
- stopped_(false), idle_accumulated_(), idle_partial_(duration::zero()), stop_(duration::zero())
- {}
-
- void idle_on_start(time_point &tmp) {
- if (stopped_) {
- idle_partial_ += tmp - this->start_;
- idle_accumulated_(idle_partial_.count());
- idle_partial_=duration::zero();
- }
- }
-
- void idle_on_stop(time_point &tmp) {
- stop_ = tmp;
- stopped_=true;
- }
-
- void idle_on_reset() {
- stopped_=false;
- idle_accumulated_ = accumulator();
- idle_partial_=duration::zero();
- stop_ = time_point(duration::zero());
- }
-
- bool stopped_;
- accumulator idle_accumulated_;
- duration idle_partial_;
- time_point stop_;
-};
-
-}
-
-
// forward declaration
template <class Clock=high_resolution_clock,
- class RunningIdleKind=kind::running,
class Accumulator=accumulators::accumulator_set<typename Clock::duration::rep,
accumulators::features<
accumulators::tag::count,
@@ -153,70 +58,70 @@
>
class stopwatch_accumulator;
- template <class Clock>
- struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> > {
+ template <class Clock, class Accumulator>
+ struct stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
typedef stopwatch_accumulator_formatter type;
};
//--------------------------------------------------------------------------------------//
- template <class Clock, class RunningIdleKind, class Accumulator >
- class stopwatch_accumulator
- : public detail::basic_stopwatch_accumulator<Clock, RunningIdleKind, Accumulator>
+ template <class Clock, class Accumulator>
+ class stopwatch_accumulator
{
- typedef detail::basic_stopwatch_accumulator<Clock, RunningIdleKind, Accumulator> base_type;
public:
typedef Clock clock;
typedef typename Clock::duration duration;
typedef typename Clock::time_point time_point;
typedef Accumulator accumulator;
- stopwatch_accumulator( ) : base_type() {}
+ stopwatch_accumulator( )
+ : running_(false), suspended_(false), accumulated_(),
+ partial_(), start_(duration::zero()), level_(0), suspend_level_(0)
+ , construction_(clock::now( ))
+ {}
std::pair<duration, time_point> restart( system::error_code & ec = system::throws ) {
time_point tmp=clock::now( ec );
if (ec) return time_point();
- if (this->running_&&(--this->level_==0)) {
- this->partial_ += tmp - this->start_;
- this->accumulated_(this->partial_.count());
- this->partial_=duration::zero();
+ if (running_&&(--level_==0)) {
+ partial_ += tmp - start_;
+ accumulated_(partial_.count());
+ partial_=duration::zero();
} else {
- this->running_=true;
+ running_=true;
}
- this->start_=tmp;
- ++this->level_;
- return std::make_pair(duration(accumulators::sum(this->accumulated_)),this->start_);
+ start_=tmp;
+ ++level_;
+ return std::make_pair(duration(accumulators::sum(accumulated_)),start_);
}
time_point start( system::error_code & ec = system::throws ) {
- if (!this->running_) {
+ if (!running_) {
time_point tmp = clock::now( ec );
if (ec) return time_point();
- ++this->level_;
- this->start_ = tmp;
- this->running_ = true;
- this->idle_on_start(tmp);
- return this->start_;
+ start_ = tmp;
+ ++level_;
+ running_ = true;
+ return start_;
} else {
- ++this->level_;
+ ++level_;
return time_point();
}
}
duration stop( system::error_code & ec = system::throws ) {
- if (this->running_) {
- if (this->level_==1) {
+ if (running_) {
+ if (level_==1) {
time_point tmp=clock::now( ec );
if (ec) return duration::zero();
- --this->level_;
- this->partial_ += tmp - this->start_;
- this->accumulated_(this->partial_.count());
- this->partial_=duration::zero();
- this->running_=false;
- this->idle_on_stop(tmp);
- return duration(accumulators::extract::sum(this->accumulated_));
+ partial_ += tmp - start_;
+ accumulated_(partial_.count());
+ partial_=duration::zero();
+ --level_;
+ running_=false;
+ return duration(accumulators::extract::sum(accumulated_));
} else {
- --this->level_;
- return duration::zero();
+ --level_;
+ return duration::zero();
}
} else {
return duration::zero();
@@ -224,14 +129,14 @@
}
duration suspend( system::error_code & ec = system::throws ) {
- if (this->running_) {
- ++this->suspend_level_;
- if (!this->suspended_) {
+ if (running_) {
+ ++suspend_level_;
+ if (!suspended_) {
time_point tmp=clock::now( ec );
if (ec) return duration::zero();
- this->partial_ += tmp - this->start_;
- this->suspended_=true;
- return duration(accumulators::sum(this->accumulated_));
+ partial_ += tmp - start_;
+ suspended_=true;
+ return duration(accumulators::sum(accumulated_));
} else {
return duration::zero();
}
@@ -240,40 +145,44 @@
}
}
time_point resume( system::error_code & ec = system::throws ) {
- if (this->suspended_&&(--this->suspend_level_==0)) {
+ if (suspended_&&(--suspend_level_==0)) {
time_point tmp = clock::now( ec );
if (ec) return time_point();
- this->start_ = tmp;
- this->suspended_=false;
- return this->start_;
+ start_ = tmp;
+ suspended_=false;
+ return start_;
} else {
return time_point();
}
}
duration elapsed( system::error_code & ec = system::throws )
{
- if (this->running_) {
- if (this->suspended_)
- return duration(accumulators::sum(this->accumulated_));
+ if (running_) {
+ if (suspended_)
+ return duration(accumulators::sum(accumulated_));
else {
time_point tmp = clock::now( ec );
if (ec) return duration::zero();
- return duration(accumulators::sum(this->accumulated_))+tmp - this->start_;
+ return duration(accumulators::sum(accumulated_))+tmp - start_;
}
} else {
- return duration(accumulators::sum(this->accumulated_));
+ return duration(accumulators::sum(accumulated_));
}
}
- void reset( ) {
- this->running_=false;
- this->suspended_=false;
- this->accumulated_ = accumulator();
- this->partial_=duration::zero();
- this->start_ = time_point(duration::zero());
- this->level_=0;
- this->suspend_level_=0;
- this->idle_on_reset();
+ void reset( system::error_code & ec = system::throws ) {
+ construction_=clock::now( ec );
+ running_=false;
+ suspended_=false;
+ accumulated_ = accumulator();
+ partial_=duration::zero();
+ start_ = time_point(duration::zero());
+ level_=0;
+ suspend_level_=0;
+ }
+ accumulator& accumulated( ) { return accumulated_; }
+ duration lifetime( system::error_code & ec = system::throws ) {
+ return clock::now( ec ) - construction_;
}
typedef stopwatch_runner<stopwatch_accumulator<Clock> > scoped_run;
@@ -281,6 +190,15 @@
typedef stopwatch_suspender<stopwatch_accumulator<Clock> > scoped_suspend;
typedef stopwatch_resumer<stopwatch_accumulator<Clock> > scoped_resume;
typedef stopwatch_reporter<stopwatch_accumulator<Clock> > reporter;
+ private:
+ bool running_;
+ bool suspended_;
+ accumulator accumulated_;
+ duration partial_;
+ time_point start_;
+ std::size_t level_;
+ std::size_t suspend_level_;
+ time_point construction_;
};
//--------------------------------------------------------------------------------------//
Modified: sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_accumulator_formatter.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -31,7 +31,7 @@
#include <boost/config/abi_prefix.hpp> // must be the last #include
-#define BOOST_CHRONO_ACCUMULATOR_FORMAT_DEFAULT "%c times, sum=%ss, min=%ms, max=%Ms, mean=%as\n"
+#define BOOST_CHRONO_ACCUMULATOR_FORMAT_DEFAULT "%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fherzs, lifetime=%ls, percentage=%p\%\n"
namespace boost { namespace chrono {
@@ -40,16 +40,16 @@
//--------------------------------------------------------------------------------------//
template <
- typename CharT=char,
- typename Traits=std::char_traits<CharT>,
+ typename CharT=char,
+ typename Traits=std::char_traits<CharT>,
class Alloc=std::allocator<CharT>
>
class basic_stopwatch_accumulator_formatter {
- public:
+ public:
typedef std::basic_string<CharT,Traits,Alloc> string_type;
typedef CharT char_type;
typedef std::basic_ostream<CharT,Traits> ostream_type;
-
+
static ostream_type & default_os();
static const char_type* default_format();
static string_type format(const char_type* s) {
@@ -68,6 +68,7 @@
typedef typename Stopwatch::accumulator accumulator;
typedef typename Stopwatch::duration duration_t;
accumulator& acc = stopwatch_.accumulated();
+ duration_t lt= stopwatch_.lifetime();
//if ( d < duration_t::zero() ) return;
if ( places > 9 )
@@ -81,7 +82,7 @@
os.precision( places );
for ( ; *format; ++format ) {
- if ( *format != '%' || !*(format+1) || !std::strchr("smMac", *(format+1)) ) {
+ if ( *format != '%' || !*(format+1) || !std::strchr("acflmMps", *(format+1)) ) {
os << *format;
} else {
++format;
@@ -97,20 +98,31 @@
break;
case 'a':
os << ((accumulators::count(acc)>0)
- ? (boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count())/accumulators::count(acc)
+ ? boost::chrono::duration<double>(duration_t(typename duration_t::rep(accumulators::mean(acc)))).count()
: 0);
break;
case 'c':
os << accumulators::count(acc);
break;
+ case 'f':
+ os << ((accumulators::count(acc)>0)
+ ? accumulators::count(acc)/boost::chrono::duration<double>(lt)
+ : 0);
+ break;
+ case 'l':
+ os << boost::chrono::duration<double>(lt).count();
+ break;
+ case 'p':
+ os << int(boost::chrono::duration<double>(duration_t(accumulators::sum(acc))).count()*100/boost::chrono::duration<double>(lt).count());
+ break;
default:
- assert(0 && "run_timer internal logic error");
+ assert(0 && "basic_stopwatch_accumulator_formatter internal logic error");
}
}
}
}
};
-
+
namespace detail {
template <typename CharT>
struct basic_stopwatch_accumulator_formatter_default_format;
@@ -121,25 +133,25 @@
#ifndef BOOST_NO_STD_WSTRING
template <>
struct basic_stopwatch_accumulator_formatter_default_format<wchar_t> {
- static const wchar_t* apply() {return L"%c times, sum=%ss, min=%ms, max=%Ms, mean=%as\n"; }
+ static const wchar_t* apply() {return L"%c times, sum=%ss, min=%ms, max=%Ms, mean=%as, frequency=%fherzs, lifetime=%ls, percentage=%p\%\n"; }
};
-
-#endif
+
+#endif
}
-
+
template <typename CharT,typename Traits, class Alloc>
- const typename basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::char_type*
+ const typename basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::char_type*
basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::default_format() {
return detail::basic_stopwatch_accumulator_formatter_default_format<CharT>::apply();
}
template <typename CharT,typename Traits, class Alloc>
- typename basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::ostream_type &
+ typename basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::ostream_type &
basic_stopwatch_accumulator_formatter<CharT,Traits,Alloc>::default_os() { return detail::default_out<CharT,Traits>::apply(); }
typedef basic_stopwatch_accumulator_formatter<char> stopwatch_accumulator_formatter;
typedef basic_stopwatch_accumulator_formatter<wchar_t> wstopwatch_accumulator_formatter;
-
+
} // namespace chrono
} // namespace boost
Modified: sandbox/chrono/boost/chrono/stopwatch_reporter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_reporter.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_reporter.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -76,7 +76,7 @@
template <class Stopwatch, class Formatter>
struct stopwatch_reporter_default_formatter<stopwatch_reporter<Stopwatch, Formatter> > {
- typedef typename stopwatch_reporter_default_formatter<Stopwatch>::type type;
+ typedef Formatter type;
};
@@ -89,7 +89,7 @@
typedef typename Formatter::string_type string_type;
typedef typename Formatter::char_type char_type;
typedef typename Formatter::ostream_type ostream_type;
-
+
explicit stopwatch_reporter( system::error_code & ec = system::throws )
: m_places(Formatter::default_places()), m_os(Formatter::default_os()), m_format(Formatter::default_format()), m_reported(false) { }
explicit stopwatch_reporter( ostream_type & os,
@@ -141,10 +141,10 @@
bool reported() const { return m_reported; }
- typedef stopwatch_runner<stopwatch_reporter<Stopwatch> > scoped_run;
- typedef stopwatch_stopper<stopwatch_reporter<Stopwatch> > scoped_stop;
- typedef stopwatch_suspender<stopwatch_reporter<Stopwatch> > scoped_suspend;
- typedef stopwatch_resumer<stopwatch_reporter<Stopwatch> > scoped_resume;
+ typedef stopwatch_runner<stopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<stopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<stopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<stopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
protected:
int m_places;
Modified: sandbox/chrono/boost/chrono/suspendible_clock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/suspendible_clock.hpp (original)
+++ sandbox/chrono/boost/chrono/suspendible_clock.hpp 2010-01-24 03:52:56 EST (Sun, 24 Jan 2010)
@@ -22,7 +22,7 @@
template < class Clock >
class suspendible_clock {
- public:
+ public:
typedef typename Clock::duration duration;
typedef typename Clock::rep rep;
typedef typename Clock::period period;
@@ -35,7 +35,7 @@
time_point suspended_time_;
duration suspended_duration_;
std::size_t suspend_level_;
-
+
duration suspended(system::error_code & ec = system::throws) {
if (!suspended_) return suspended_duration_;
else {
@@ -45,7 +45,7 @@
return suspended_duration_ + tmp - suspended_time_;
}
}
-
+
void suspend( system::error_code & ec = system::throws ) {
if (!suspended_) {
time_point tmp;
@@ -67,7 +67,7 @@
suspended_=false;
}
}
-
+
};
static thread_specific_context* instance(system::error_code & ec) {
thread_specific_context* ptr= ptr_.get();
@@ -86,7 +86,7 @@
ptr_.reset(ptr);
} catch (...) {
//ec=...
- return 0;
+ return 0;
}
}
}
@@ -120,7 +120,7 @@
class scoped_suspend {
public:
scoped_suspend(system::error_code & ec = system::throws)
- : ptr_(instance(ec))
+ : ptr_(instance(ec))
{
ptr_->suspend(ec);
}
@@ -134,26 +134,30 @@
scoped_suspend(const scoped_suspend&); // = delete;
scoped_suspend& operator=(const scoped_suspend&); // = delete;
};
-
+
};
template < class Clock >
thread_specific_ptr<typename suspendible_clock<Clock>::thread_specific_context> suspendible_clock<Clock>::ptr_;
-
-
-
+
+
+
template <class Clock>
struct is_suspendible<suspendible_clock<Clock> > : mpl:: true_ {};
-
-
+
+
template <class Clock>
- class scoped_suspend<suspendible_clock<Clock> >
+ class scoped_suspend<suspendible_clock<Clock> >
: public suspendible_clock<Clock>::scoped_suspend {
public:
scoped_suspend(system::error_code & ec = system::throws) : Clock::scoped_suspend(ec) {}
- };
-
+ private:
+ scoped_suspend(); // = delete;
+ scoped_suspend(const scoped_suspend&); // = delete;
+ scoped_suspend& operator=(const scoped_suspend&); // = delete;
+ };
+
} // namespace chrono
} // namespace boost
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