summaryrefslogtreecommitdiff
path: root/base/time
diff options
context:
space:
mode:
authorCronet Mainline Eng <cronet-mainline-eng+copybara@google.com>2024-05-28 13:59:50 +0900
committerMotomu Utsumi <motomuman@google.com>2024-05-28 14:11:54 +0900
commit168f7e285114554eb2ac9bc22343cca461355b50 (patch)
treec65ccc97fb3dc01e329951c1c7c7901aef7b7a2a /base/time
parent5cfdd35118d5a23349255971e97737e32895ec0f (diff)
downloadcronet-168f7e285114554eb2ac9bc22343cca461355b50.tar.gz
Import Cronet version 122.0.6261.43
FolderOrigin-RevId: /tmp/copybara-origin/src Change-Id: Ifb7b548cde690e10cc102366bc538e744efa902b
Diffstat (limited to 'base/time')
-rw-r--r--base/time/time.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/base/time/time.h b/base/time/time.h
index c40141aff..8928e9b95 100644
--- a/base/time/time.h
+++ b/base/time/time.h
@@ -66,6 +66,7 @@
#include <time.h>
#include <compare>
+#include <concepts>
#include <iosfwd>
#include <limits>
#include <ostream>
@@ -663,11 +664,10 @@ class BASE_EXPORT Time : public time_internal::TimeBase<Time> {
// version; otherwise such calls would need to manually cast their args to
// int64_t, since the compiler isn't sure whether to promote to int64_t or
// double.
- template <typename T,
- typename = std::enable_if_t<
- std::is_integral_v<T> && !std::is_same_v<T, int64_t> &&
- (sizeof(T) < sizeof(int64_t) ||
- (sizeof(T) == sizeof(int64_t) && std::is_signed_v<T>))>>
+ template <typename T>
+ requires(std::integral<T> && !std::same_as<T, int64_t> &&
+ (sizeof(T) < sizeof(int64_t) ||
+ (sizeof(T) == sizeof(int64_t) && std::is_signed_v<T>)))
static constexpr Time FromMillisecondsSinceUnixEpoch(T ms_since_epoch) {
return FromMillisecondsSinceUnixEpoch(int64_t{ms_since_epoch});
}