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

Side by Side Diff: base/numerics/safe_math.h

Issue 2523663002: Remove remaining base dependencies from base/numerics (Closed)
Patch Set: fix gcc compile Created 4 years 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 unified diff | Download patch
« no previous file with comments | « base/numerics/safe_conversions.h ('k') | base/time/time.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_NUMERICS_SAFE_MATH_H_ 5 #ifndef BASE_NUMERICS_SAFE_MATH_H_
6 #define BASE_NUMERICS_SAFE_MATH_H_ 6 #define BASE_NUMERICS_SAFE_MATH_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
11 #include <type_traits> 11 #include <type_traits>
12 12
13 #include "base/logging.h"
14 #include "base/numerics/safe_math_impl.h" 13 #include "base/numerics/safe_math_impl.h"
15 14
16 namespace base { 15 namespace base {
17 16
18 namespace internal { 17 namespace internal {
19 18
20 // CheckedNumeric implements all the logic and operators for detecting integer 19 // CheckedNumeric implements all the logic and operators for detecting integer
21 // boundary conditions such as overflow, underflow, and invalid conversions. 20 // boundary conditions such as overflow, underflow, and invalid conversions.
22 // The CheckedNumeric type implicitly converts from floating point and integer 21 // The CheckedNumeric type implicitly converts from floating point and integer
23 // data types, and contains overloads for basic arithmetic operations (i.e.: +, 22 // data types, and contains overloads for basic arithmetic operations (i.e.: +,
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 276
278 #undef BASE_NUMERIC_ARITHMETIC_OPERATORS 277 #undef BASE_NUMERIC_ARITHMETIC_OPERATORS
279 278
280 } // namespace internal 279 } // namespace internal
281 280
282 using internal::CheckedNumeric; 281 using internal::CheckedNumeric;
283 282
284 } // namespace base 283 } // namespace base
285 284
286 #endif // BASE_NUMERICS_SAFE_MATH_H_ 285 #endif // BASE_NUMERICS_SAFE_MATH_H_
OLDNEW
« no previous file with comments | « base/numerics/safe_conversions.h ('k') | base/time/time.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698