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

Unified Diff: base/safe_numerics.h

Issue 12051089: fix checked_numeric_cast comments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/safe_numerics_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/safe_numerics.h
diff --git a/base/safe_numerics.h b/base/safe_numerics.h
index 3d47cf24ed5eb9553ae4edae285699ee36a0e923..ce5c72fcc770d0b75483286ae2f71a747ca844cb 100644
--- a/base/safe_numerics.h
+++ b/base/safe_numerics.h
@@ -120,10 +120,10 @@ inline bool IsValidNumericCast(Source source) {
} // namespace internal
-// numeric_cast<> is analogous to static_cast<> for numeric types, except that
-// it CHECKs that the specified numeric conversion will not overflow or
-// underflow. Floating point arguments are not currently allowed (this is
-// COMPILE_ASSERTd), though this could be supported if necessary.
+// checked_numeric_cast<> is analogous to static_cast<> for numeric types,
+// except that it CHECKs that the specified numeric conversion will not
+// overflow or underflow. Floating point arguments are not currently allowed
+// (this is COMPILE_ASSERTd), though this could be supported if necessary.
template <class Dest, class Source>
inline Dest checked_numeric_cast(Source source) {
CHECK(internal::IsValidNumericCast<Dest>(source));
« no previous file with comments | « no previous file | base/safe_numerics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698