Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74444 - in trunk/boost/chrono: . detail/inlined/mac detail/inlined/posix detail/inlined/win
From: vicente.botet_at_[hidden]
Date: 2011-09-18 04:18:47


Author: viboes
Date: 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
New Revision: 74444
URL: http://svn.boost.org/trac/boost/changeset/74444

Log:
Chrono: Set now() noexcept
Text files modified:
   trunk/boost/chrono/detail/inlined/mac/chrono.hpp | 14 +--
   trunk/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp | 98 +++++++++++++++++++++++++++
   trunk/boost/chrono/detail/inlined/posix/chrono.hpp | 20 +----
   trunk/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp | 139 ++++++++++++++++++++++++++++++++++++---
   trunk/boost/chrono/detail/inlined/posix/thread_clock.hpp | 6 -
   trunk/boost/chrono/detail/inlined/win/chrono.hpp | 20 +----
   trunk/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp | 120 +++++++++++++++++++++++++++------
   trunk/boost/chrono/detail/inlined/win/thread_clock.hpp | 10 --
   trunk/boost/chrono/process_cpu_clocks.hpp | 15 ++--
   trunk/boost/chrono/system_clocks.hpp | 12 +-
   trunk/boost/chrono/thread_clock.hpp | 2
   11 files changed, 355 insertions(+), 101 deletions(-)

Modified: trunk/boost/chrono/detail/inlined/mac/chrono.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/mac/chrono.hpp (original)
+++ trunk/boost/chrono/detail/inlined/mac/chrono.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -26,7 +26,7 @@
 // which has a field for seconds and a field for microseconds.
 // Fill in the timeval and then convert that to the time_point
 system_clock::time_point
-system_clock::now()
+system_clock::now() BOOST_CHRONO_NOEXCEPT
 {
     timeval tv;
     gettimeofday(&tv, 0);
@@ -49,14 +49,14 @@
 // an integral count of seconds since New Years 1970 (same epoch as timeval).
 // Just get the duration out of the time_point and truncate it to seconds.
 time_t
-system_clock::to_time_t(const time_point& t)
+system_clock::to_time_t(const time_point& t) BOOST_CHRONO_NOEXCEPT
 {
     return time_t(duration_cast<seconds>(t.time_since_epoch()).count());
 }
 
 // Just turn the time_t into a count of seconds and construct a time_point with it.
 system_clock::time_point
-system_clock::from_time_t(time_t t)
+system_clock::from_time_t(time_t t) BOOST_CHRONO_NOEXCEPT
 {
     return system_clock::time_point(seconds(t));
 }
@@ -191,17 +191,13 @@
 }
 
 steady_clock::time_point
-steady_clock::now()
+steady_clock::now() BOOST_CHRONO_NOEXCEPT
 {
     static kern_return_t err;
     static chrono_detail::FP fp = chrono_detail::init_steady_clock(err);
     if ( err != 0 )
     {
- boost::throw_exception(
- system::system_error(
- err,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::steady_clock" ));
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
     }
     return time_point(duration(fp()));
 }

Modified: trunk/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp (original)
+++ trunk/boost/chrono/detail/inlined/mac/process_cpu_clocks.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -41,6 +41,30 @@
     }
 }
 
+process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(c)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
+
 process_real_cpu_clock::time_point process_real_cpu_clock::now(
         system::error_code & ec)
 {
@@ -93,6 +117,29 @@
     }
 }
 
+process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(c)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
+
 process_user_cpu_clock::time_point process_user_cpu_clock::now(
         system::error_code & ec)
 {
@@ -144,6 +191,29 @@
     }
 }
 
+process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+return time_point();
+}
+
 process_system_cpu_clock::time_point process_system_cpu_clock::now(
         system::error_code & ec)
 {
@@ -195,11 +265,35 @@
     }
 }
 
+process_cpu_clock::time_point process_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ time_point::rep r(
+ c*chrono_detail::tick_factor(),
+ (tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor(),
+ (tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor());
+ return time_point(duration(r));
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
+
 process_cpu_clock::time_point process_cpu_clock::now(
         system::error_code & ec )
 {
-
-
     tms tm;
     clock_t c = ::times( &tm );
     if ( c == clock_t(-1) ) // error

Modified: trunk/boost/chrono/detail/inlined/posix/chrono.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/posix/chrono.hpp (original)
+++ trunk/boost/chrono/detail/inlined/posix/chrono.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -17,16 +17,12 @@
 namespace chrono
 {
 
- system_clock::time_point system_clock::now()
+ system_clock::time_point system_clock::now() BOOST_CHRONO_NOEXCEPT
   {
     timespec ts;
     if ( ::clock_gettime( CLOCK_REALTIME, &ts ) )
     {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::system_clock" ));
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
     }
 
     return time_point(duration(
@@ -61,28 +57,24 @@
       static_cast<system_clock::rep>( ts.tv_sec ) * 1000000000 + ts.tv_nsec));
   }
 
- std::time_t system_clock::to_time_t(const system_clock::time_point& t)
+ std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_CHRONO_NOEXCEPT
   {
       return static_cast<std::time_t>( t.time_since_epoch().count() / 1000000000 );
   }
 
- system_clock::time_point system_clock::from_time_t(std::time_t t)
+ system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_CHRONO_NOEXCEPT
   {
       return time_point(duration(static_cast<system_clock::rep>(t) * 1000000000));
   }
 
 #ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
 
- steady_clock::time_point steady_clock::now()
+ steady_clock::time_point steady_clock::now() BOOST_CHRONO_NOEXCEPT
   {
     timespec ts;
     if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) )
     {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::steady_clock" ));
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
     }
 
     return time_point(duration(

Modified: trunk/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp (original)
+++ trunk/boost/chrono/detail/inlined/posix/process_cpu_clocks.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -40,6 +40,29 @@
   }
 }
 
+process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(c)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
 process_real_cpu_clock::time_point process_real_cpu_clock::now(
         system::error_code & ec)
 {
@@ -92,6 +115,29 @@
     }
 }
 
+process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
+
 process_user_cpu_clock::time_point process_user_cpu_clock::now(
         system::error_code & ec)
 {
@@ -143,8 +189,55 @@
     }
 }
 
-process_system_cpu_clock::time_point process_system_cpu_clock::now(
- system::error_code & ec)
+process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
+
+
+process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return time_point();
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ return time_point(
+ microseconds(tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+}
+
+process_cpu_clock::time_point process_cpu_clock::now(
+ system::error_code & ec )
 {
     tms tm;
     clock_t c = ::times( &tm );
@@ -156,7 +249,7 @@
                     system::system_error(
                             errno,
                             BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_system_cpu_clock" ));
+ "chrono::process_clock" ));
         }
         else
         {
@@ -168,12 +261,11 @@
     {
         if ( chrono_detail::tick_factor() != -1 )
         {
- if (!BOOST_CHRONO_IS_THROWS(ec))
- {
- ec.clear();
- }
- return time_point(
- microseconds(tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor());
+ time_point::rep r(
+ c*chrono_detail::tick_factor(),
+ (tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor(),
+ (tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor());
+ return time_point(duration(r));
         }
         else
         {
@@ -183,7 +275,7 @@
                         system::system_error(
                                 errno,
                                 BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_system_cpu_clock" ));
+ "chrono::process_clock" ));
             }
             else
             {
@@ -194,11 +286,34 @@
     }
 }
 
+process_cpu_clock::time_point process_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+ tms tm;
+ clock_t c = ::times( &tm );
+ if ( c == clock_t(-1) ) // error
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ else
+ {
+ if ( chrono_detail::tick_factor() != -1 )
+ {
+ time_point::rep r(
+ c*chrono_detail::tick_factor(),
+ (tm.tms_utime + tm.tms_cutime)*chrono_detail::tick_factor(),
+ (tm.tms_stime + tm.tms_cstime)*chrono_detail::tick_factor());
+ return time_point(duration(r));
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ }
+ return time_point();
+}
 process_cpu_clock::time_point process_cpu_clock::now(
         system::error_code & ec )
 {
-
-
     tms tm;
     clock_t c = ::times( &tm );
     if ( c == clock_t(-1) ) // error

Modified: trunk/boost/chrono/detail/inlined/posix/thread_clock.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/posix/thread_clock.hpp (original)
+++ trunk/boost/chrono/detail/inlined/posix/thread_clock.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -35,11 +35,7 @@
         if ( ::clock_gettime( clock_id, &ts ) )
 #endif
         {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::thread_clock" ));
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
         }
 
         // transform to nanoseconds

Modified: trunk/boost/chrono/detail/inlined/win/chrono.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/win/chrono.hpp (original)
+++ trunk/boost/chrono/detail/inlined/win/chrono.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -23,7 +23,7 @@
 namespace chrono_detail
 {
 
- BOOST_CHRONO_INLINE double get_nanosecs_per_tic()
+ BOOST_CHRONO_INLINE double get_nanosecs_per_tic() BOOST_CHRONO_NOEXCEPT
   {
       boost::detail::win32::LARGE_INTEGER_ freq;
       if ( !boost::detail::win32::QueryPerformanceFrequency( &freq ) )
@@ -33,7 +33,7 @@
 
 }
 
- steady_clock::time_point steady_clock::now()
+ steady_clock::time_point steady_clock::now() BOOST_CHRONO_NOEXCEPT
   {
     static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
 
@@ -41,15 +41,7 @@
     if ( (nanosecs_per_tic <= 0.0L) ||
             (!boost::detail::win32::QueryPerformanceCounter( &pcount )) )
     {
- boost::detail::win32::DWORD_ cause =
- (nanosecs_per_tic <= 0.0L
- ? ERROR_NOT_SUPPORTED
- : boost::detail::win32::GetLastError());
- boost::throw_exception(
- system::system_error(
- cause,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::steady_clock" ));
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
     }
 
     return steady_clock::time_point(steady_clock::duration(
@@ -92,7 +84,7 @@
   }
 
   BOOST_CHRONO_INLINE
- system_clock::time_point system_clock::now()
+ system_clock::time_point system_clock::now() BOOST_CHRONO_NOEXCEPT
   {
     boost::detail::win32::FILETIME_ ft;
   #if defined(UNDER_CE)
@@ -128,7 +120,7 @@
   }
 
   BOOST_CHRONO_INLINE
- std::time_t system_clock::to_time_t(const system_clock::time_point& t)
+ std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_CHRONO_NOEXCEPT
   {
       __int64 temp = t.time_since_epoch().count();
 
@@ -143,7 +135,7 @@
   }
 
   BOOST_CHRONO_INLINE
- system_clock::time_point system_clock::from_time_t(std::time_t t)
+ system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_CHRONO_NOEXCEPT
   {
       __int64 temp = t;
       temp *= 10000000;

Modified: trunk/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp (original)
+++ trunk/boost/chrono/detail/inlined/win/process_cpu_clocks.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -26,6 +26,25 @@
 namespace chrono
 {
 
+process_real_cpu_clock::time_point process_real_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+
+ // note that Windows uses 100 nanosecond ticks for FILETIME
+ boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+
+ if ( boost::detail::win32::GetProcessTimes(
+ boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ &system_time, &user_time ) )
+ {
+ return time_point(steady_clock::now().time_since_epoch());
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ }
+ return time_point();
+}
+
 process_real_cpu_clock::time_point process_real_cpu_clock::now(
         system::error_code & ec)
 {
@@ -33,11 +52,6 @@
     // note that Windows uses 100 nanosecond ticks for FILETIME
     boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
 
- #ifdef UNDER_CE
- // Windows CE does not support GetProcessTimes
- assert( 0 && "GetProcessTimes not supported under Windows CE" );
- return time_point();
- #else
     if ( boost::detail::win32::GetProcessTimes(
             boost::detail::win32::GetCurrentProcess(), &creation, &exit,
             &system_time, &user_time ) )
@@ -65,9 +79,32 @@
             return time_point();
         }
     }
- #endif
 
 }
+
+process_user_cpu_clock::time_point process_user_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+
+ // note that Windows uses 100 nanosecond ticks for FILETIME
+ boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+
+ if ( boost::detail::win32::GetProcessTimes(
+ boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ &system_time, &user_time ) )
+ {
+ return time_point(duration(
+ ((static_cast<process_user_cpu_clock::rep>(user_time.dwHighDateTime) << 32)
+ | user_time.dwLowDateTime) * 100
+ ));
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return time_point();
+ }
+
+}
+
 process_user_cpu_clock::time_point process_user_cpu_clock::now(
         system::error_code & ec)
 {
@@ -75,11 +112,6 @@
     // note that Windows uses 100 nanosecond ticks for FILETIME
     boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
 
- #ifdef UNDER_CE
- // Windows CE does not support GetProcessTimes
- assert( 0 && "GetProcessTimes not supported under Windows CE" );
- return time_point();
- #else
     if ( boost::detail::win32::GetProcessTimes(
             boost::detail::win32::GetCurrentProcess(), &creation, &exit,
             &system_time, &user_time ) )
@@ -110,9 +142,32 @@
             return time_point();
         }
     }
- #endif
 
 }
+
+process_system_cpu_clock::time_point process_system_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+
+ // note that Windows uses 100 nanosecond ticks for FILETIME
+ boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+
+ if ( boost::detail::win32::GetProcessTimes(
+ boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ &system_time, &user_time ) )
+ {
+ return time_point(duration(
+ ((static_cast<process_system_cpu_clock::rep>(system_time.dwHighDateTime) << 32)
+ | system_time.dwLowDateTime) * 100
+ ));
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return time_point();
+ }
+
+}
+
 process_system_cpu_clock::time_point process_system_cpu_clock::now(
         system::error_code & ec)
 {
@@ -120,11 +175,6 @@
     // note that Windows uses 100 nanosecond ticks for FILETIME
     boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
 
- #ifdef UNDER_CE
- // Windows CE does not support GetProcessTimes
- assert( 0 && "GetProcessTimes not supported under Windows CE" );
- return time_point();
- #else
     if ( boost::detail::win32::GetProcessTimes(
             boost::detail::win32::GetCurrentProcess(), &creation, &exit,
             &system_time, &user_time ) )
@@ -155,9 +205,37 @@
             return time_point();
         }
     }
- #endif
   
 }
+process_cpu_clock::time_point process_cpu_clock::now() BOOST_CHRONO_NOEXCEPT
+{
+
+ // note that Windows uses 100 nanosecond ticks for FILETIME
+ boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+
+ if ( boost::detail::win32::GetProcessTimes(
+ boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ &system_time, &user_time ) )
+ {
+ time_point::rep r(
+ steady_clock::now().time_since_epoch().count(),
+ ((static_cast<process_user_cpu_clock::rep>(user_time.dwHighDateTime) << 32)
+ | user_time.dwLowDateTime
+ ) * 100,
+ ((static_cast<process_system_cpu_clock::rep>(system_time.dwHighDateTime) << 32)
+ | system_time.dwLowDateTime
+ ) * 100
+ );
+ return time_point(duration(r));
+ }
+ else
+ {
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return time_point();
+ }
+
+}
+
 process_cpu_clock::time_point process_cpu_clock::now(
         system::error_code & ec )
 {
@@ -165,11 +243,6 @@
     // note that Windows uses 100 nanosecond ticks for FILETIME
     boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
 
- #ifdef UNDER_CE
- // Windows CE does not support GetProcessTimes
- assert( 0 && "GetProcessTimes not supported under Windows CE" );
- return time_point();
- #else
     if ( boost::detail::win32::GetProcessTimes(
             boost::detail::win32::GetCurrentProcess(), &creation, &exit,
             &system_time, &user_time ) )
@@ -206,7 +279,6 @@
             return time_point();
         }
     }
- #endif
 
 }
 } // namespace chrono

Modified: trunk/boost/chrono/detail/inlined/win/thread_clock.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/win/thread_clock.hpp (original)
+++ trunk/boost/chrono/detail/inlined/win/thread_clock.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -66,7 +66,7 @@
     }
 }
 
-thread_clock::time_point thread_clock::now( )
+thread_clock::time_point thread_clock::now() BOOST_CHRONO_NOEXCEPT
 {
 
     // note that Windows uses 100 nanosecond ticks for FILETIME
@@ -85,15 +85,11 @@
                         | system_time.dwLowDateTime) * 100 );
 
         return time_point(system+user);
-
     }
     else
     {
- boost::throw_exception(
- system::system_error(
- boost::detail::win32::GetLastError(),
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::thread_clock" ));
+ BOOST_ASSERT(0 && "Boost::Chrono - Internal Error");
+ return time_point();
     }
 
 }

Modified: trunk/boost/chrono/process_cpu_clocks.hpp
==============================================================================
--- trunk/boost/chrono/process_cpu_clocks.hpp (original)
+++ trunk/boost/chrono/process_cpu_clocks.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -36,8 +36,8 @@
         typedef chrono::time_point<process_real_cpu_clock> time_point;
         BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
 
- static BOOST_CHRONO_INLINE time_point now(
- system::error_code & ec = BOOST_CHRONO_THROWS );
+ static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
     };
 
     class BOOST_CHRONO_DECL process_user_cpu_clock {
@@ -48,8 +48,8 @@
         typedef chrono::time_point<process_user_cpu_clock> time_point;
         BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
 
- static BOOST_CHRONO_INLINE time_point now(
- system::error_code & ec = BOOST_CHRONO_THROWS );
+ static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
     };
 
     class BOOST_CHRONO_DECL process_system_cpu_clock {
@@ -60,8 +60,8 @@
         typedef chrono::time_point<process_system_cpu_clock> time_point;
         BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
 
- static BOOST_CHRONO_INLINE time_point now(
- system::error_code & ec = BOOST_CHRONO_THROWS );
+ static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point now(system::error_code & ec );
     };
 
         struct process_cpu_clock_times
@@ -184,8 +184,9 @@
         typedef chrono::time_point<process_cpu_clock> time_point;
         BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
 
+ static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT;
         static BOOST_CHRONO_INLINE time_point now(
- system::error_code & ec = BOOST_CHRONO_THROWS );
+ system::error_code & ec );
     };
 
     template <class CharT, class Traits>

Modified: trunk/boost/chrono/system_clocks.hpp
==============================================================================
--- trunk/boost/chrono/system_clocks.hpp (original)
+++ trunk/boost/chrono/system_clocks.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -127,11 +127,11 @@
       typedef chrono::time_point<system_clock> time_point;
       BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = false;
 
- static BOOST_CHRONO_INLINE time_point now(); // throws on error
- static BOOST_CHRONO_INLINE time_point now(system::error_code & ec); // never throws
+ static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT; // throws on error
+ static BOOST_CHRONO_INLINE time_point now(system::error_code & ec) ; // never throws
 
- static BOOST_CHRONO_INLINE std::time_t to_time_t(const time_point& t);
- static BOOST_CHRONO_INLINE time_point from_time_t(std::time_t t);
+ static BOOST_CHRONO_INLINE std::time_t to_time_t(const time_point& t) BOOST_CHRONO_NOEXCEPT;
+ static BOOST_CHRONO_INLINE time_point from_time_t(std::time_t t) BOOST_CHRONO_NOEXCEPT;
   };
 
 //----------------------------------------------------------------------------//
@@ -151,8 +151,8 @@
       typedef chrono::time_point<steady_clock> time_point;
       BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
 
- static BOOST_CHRONO_INLINE time_point now(); // throws on error
- static BOOST_CHRONO_INLINE time_point now(system::error_code & ec); // never throws
+ static BOOST_CHRONO_INLINE time_point now() BOOST_CHRONO_NOEXCEPT; // throws on error
+ static BOOST_CHRONO_INLINE time_point now(system::error_code & ec) ; // never throws
   };
 #endif
 //----------------------------------------------------------------------------//

Modified: trunk/boost/chrono/thread_clock.hpp
==============================================================================
--- trunk/boost/chrono/thread_clock.hpp (original)
+++ trunk/boost/chrono/thread_clock.hpp 2011-09-18 04:18:43 EDT (Sun, 18 Sep 2011)
@@ -32,7 +32,7 @@
     typedef chrono::time_point<thread_clock> time_point;
     BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = BOOST_CHRONO_THREAD_CLOCK_IS_STEADY;
 
- static BOOST_CHRONO_INLINE time_point now( );
+ static BOOST_CHRONO_INLINE time_point now( ) BOOST_CHRONO_NOEXCEPT;
     static BOOST_CHRONO_INLINE time_point now( system::error_code & ec );
 };
 } // namespace chrono


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