[cfe-commits] [libcxx] r132265 - in /libcxx/trunk: include/chrono src/chrono.cpp
Howard Hinnant
hhinnant at apple.com
Sat May 28 11:34:36 PDT 2011
Author: hhinnant
Date: Sat May 28 13:34:36 2011
New Revision: 132265
URL: http://llvm.org/viewvc/llvm-project?rev=132265&view=rev
Log:
noexcept for <chrono>.
Modified:
libcxx/trunk/include/chrono
libcxx/trunk/src/chrono.cpp
Modified: libcxx/trunk/include/chrono
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/chrono?rev=132265&r1=132264&r2=132265&view=diff
==============================================================================
--- libcxx/trunk/include/chrono (original)
+++ libcxx/trunk/include/chrono Sat May 28 13:34:36 2011
@@ -225,9 +225,9 @@
typedef chrono::time_point<system_clock> time_point;
static const bool is_steady = false;
- static time_point now();
- static time_t to_time_t (const time_point& __t);
- static time_point from_time_t(time_t __t);
+ static time_point now() noexcept;
+ static time_t to_time_t (const time_point& __t) noexcept;
+ static time_point from_time_t(time_t __t) noexcept;
};
class steady_clock
@@ -239,7 +239,7 @@
typedef chrono::time_point<steady_clock, duration> time_point;
static const bool is_steady = true;
- static time_point now();
+ static time_point now() noexcept;
};
typedef steady_clock high_resolution_clock;
@@ -845,9 +845,9 @@
typedef chrono::time_point<system_clock> time_point;
static const bool is_steady = false;
- static time_point now();
- static time_t to_time_t (const time_point& __t);
- static time_point from_time_t(time_t __t);
+ static time_point now() _NOEXCEPT;
+ static time_t to_time_t (const time_point& __t) _NOEXCEPT;
+ static time_point from_time_t(time_t __t) _NOEXCEPT;
};
class _LIBCPP_VISIBLE steady_clock
@@ -859,7 +859,7 @@
typedef chrono::time_point<steady_clock, duration> time_point;
static const bool is_steady = true;
- static time_point now();
+ static time_point now() _NOEXCEPT;
};
typedef steady_clock high_resolution_clock;
Modified: libcxx/trunk/src/chrono.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/chrono.cpp?rev=132265&r1=132264&r2=132265&view=diff
==============================================================================
--- libcxx/trunk/src/chrono.cpp (original)
+++ libcxx/trunk/src/chrono.cpp Sat May 28 13:34:36 2011
@@ -25,7 +25,7 @@
// system_clock
system_clock::time_point
-system_clock::now()
+system_clock::now() _NOEXCEPT
{
timeval tv;
gettimeofday(&tv, 0);
@@ -33,13 +33,13 @@
}
time_t
-system_clock::to_time_t(const time_point& t)
+system_clock::to_time_t(const time_point& t) _NOEXCEPT
{
return time_t(duration_cast<seconds>(t.time_since_epoch()).count());
}
system_clock::time_point
-system_clock::from_time_t(time_t t)
+system_clock::from_time_t(time_t t) _NOEXCEPT
{
return system_clock::time_point(seconds(t));
}
@@ -97,7 +97,7 @@
#pragma GCC visibility pop
steady_clock::time_point
-steady_clock::now()
+steady_clock::now() _NOEXCEPT
{
static FP fp = init_steady_clock();
return time_point(duration(fp()));
@@ -114,7 +114,7 @@
// instead.
steady_clock::time_point
-steady_clock::now()
+steady_clock::now() _NOEXCEPT
{
struct timespec tp;
if (0 != clock_gettime(CLOCK_MONOTONIC, &tp))
More information about the cfe-commits
mailing list