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

Unified Diff: base/numerics/safe_conversions.h

Issue 1475233002: Remove base::enable_if (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « base/callback_internal.h ('k') | base/numerics/safe_math.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/numerics/safe_conversions.h
diff --git a/base/numerics/safe_conversions.h b/base/numerics/safe_conversions.h
index 13c24ce4fcb8711779fe426004e6fb35526f3a96..5e5ed77718f5d960c048a527dd057746c380fd87 100644
--- a/base/numerics/safe_conversions.h
+++ b/base/numerics/safe_conversions.h
@@ -6,6 +6,7 @@
#define BASE_NUMERICS_SAFE_CONVERSIONS_H_
#include <limits>
+#include <type_traits>
#include "base/logging.h"
#include "base/numerics/safe_conversions_impl.h"
@@ -23,7 +24,7 @@ inline bool IsValueInRangeForNumericType(Src value) {
// Convenience function for determining if a numeric value is negative without
// throwing compiler warnings on: unsigned(value) < 0.
template <typename T>
-typename enable_if<std::numeric_limits<T>::is_signed, bool>::type
+typename std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
IsValueNegative(T value) {
static_assert(std::numeric_limits<T>::is_specialized,
"Argument must be numeric.");
@@ -31,8 +32,8 @@ IsValueNegative(T value) {
}
template <typename T>
-typename enable_if<!std::numeric_limits<T>::is_signed, bool>::type
-IsValueNegative(T) {
+typename std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type
+ IsValueNegative(T) {
static_assert(std::numeric_limits<T>::is_specialized,
"Argument must be numeric.");
return false;
« no previous file with comments | « base/callback_internal.h ('k') | base/numerics/safe_math.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698