Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1504)

Unified Diff: base/time/time.h

Issue 2241603002: Add explicit TimeDelta constexpr copy constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/time/time_unittest.cc » ('j') | base/time/time_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/time.h
diff --git a/base/time/time.h b/base/time/time.h
index be0eb20f88a4df500d5dfe289fc0d35fed6acd64..17979f598b779a561554e5bb826e06c8f27677d2 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -242,6 +242,9 @@ class BASE_EXPORT TimeDelta {
return delta_ >= other.delta_;
}
+ // This works around crbug.com/635974
+ constexpr TimeDelta(const TimeDelta& other) : delta_(other.delta_) {}
miu 2016/08/11 21:48:56 Since the bug is Windows-specific, please surround
liberato (no reviews please) 2016/08/11 22:10:35 Done.
+
private:
friend int64_t time_internal::SaturatedAdd(TimeDelta delta, int64_t value);
friend int64_t time_internal::SaturatedSub(TimeDelta delta, int64_t value);
« no previous file with comments | « no previous file | base/time/time_unittest.cc » ('j') | base/time/time_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698