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

Unified Diff: webrtc/base/safe_compare.h

Issue 2802423002: Rename safe_cmp::{Eq,Ne,Lt,Le,Ge,Gt} to Safe{Eq,Ne,Lt,Le,Ge,Gt} (Closed)
Patch Set: Created 3 years, 6 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 | « webrtc/base/checks.h ('k') | webrtc/base/safe_compare_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/safe_compare.h
diff --git a/webrtc/base/safe_compare.h b/webrtc/base/safe_compare.h
index 0350d5df81785084f2fad4b06f3543d6bc4f8867..a57f08293a05f801e54efee939879f2749bdc519 100644
--- a/webrtc/base/safe_compare.h
+++ b/webrtc/base/safe_compare.h
@@ -10,12 +10,12 @@
// This file defines six constexpr functions:
//
-// rtc::safe_cmp::Eq // ==
-// rtc::safe_cmp::Ne // !=
-// rtc::safe_cmp::Lt // <
-// rtc::safe_cmp::Le // <=
-// rtc::safe_cmp::Gt // >
-// rtc::safe_cmp::Ge // >=
+// rtc::SafeEq // ==
+// rtc::SafeNe // !=
+// rtc::SafeLt // <
+// rtc::SafeLe // <=
+// rtc::SafeGt // >
+// rtc::SafeGe // >=
//
// They each accept two arguments of arbitrary types, and in almost all cases,
// they simply call the appropriate comparison operator. However, if both
@@ -40,7 +40,6 @@
#include "webrtc/base/type_traits.h"
namespace rtc {
-namespace safe_cmp {
namespace safe_cmp_impl {
@@ -153,16 +152,15 @@ RTC_SAFECMP_MAKE_OP(GeOp, >=)
template <typename T1, typename T2> \
constexpr \
typename std::enable_if<IsIntlike<T1>::value && IsIntlike<T2>::value, \
- bool>::type \
- name(T1 a, T2 b) { \
+ bool>::type Safe##name(T1 a, T2 b) { \
/* Unary plus here turns enums into real integral types. */ \
return safe_cmp_impl::Cmp<safe_cmp_impl::name##Op>(+a, +b); \
} \
template <typename T1, typename T2> \
constexpr \
typename std::enable_if<!IsIntlike<T1>::value || !IsIntlike<T2>::value, \
- bool>::type \
- name(const T1& a, const T2& b) { \
+ bool>::type Safe##name(const T1& a, \
+ const T2& b) { \
return safe_cmp_impl::name##Op::Op(a, b); \
}
RTC_SAFECMP_MAKE_FUN(Eq)
@@ -173,7 +171,6 @@ RTC_SAFECMP_MAKE_FUN(Gt)
RTC_SAFECMP_MAKE_FUN(Ge)
#undef RTC_SAFECMP_MAKE_FUN
-} // namespace safe_cmp
} // namespace rtc
#endif // WEBRTC_BASE_SAFE_COMPARE_H_
« no previous file with comments | « webrtc/base/checks.h ('k') | webrtc/base/safe_compare_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698