OLD | NEW |
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> |
| 9 |
8 #include "base/numerics/safe_math_impl.h" | 10 #include "base/numerics/safe_math_impl.h" |
9 | 11 |
10 namespace base { | 12 namespace base { |
11 | 13 |
12 namespace internal { | 14 namespace internal { |
13 | 15 |
14 // CheckedNumeric implements all the logic and operators for detecting integer | 16 // CheckedNumeric implements all the logic and operators for detecting integer |
15 // boundary conditions such as overflow, underflow, and invalid conversions. | 17 // boundary conditions such as overflow, underflow, and invalid conversions. |
16 // The CheckedNumeric type implicitly converts from floating point and integer | 18 // The CheckedNumeric type implicitly converts from floating point and integer |
17 // data types, and contains overloads for basic arithmetic operations (i.e.: +, | 19 // data types, and contains overloads for basic arithmetic operations (i.e.: +, |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 291 |
290 #undef BASE_NUMERIC_ARITHMETIC_OPERATORS | 292 #undef BASE_NUMERIC_ARITHMETIC_OPERATORS |
291 | 293 |
292 } // namespace internal | 294 } // namespace internal |
293 | 295 |
294 using internal::CheckedNumeric; | 296 using internal::CheckedNumeric; |
295 | 297 |
296 } // namespace base | 298 } // namespace base |
297 | 299 |
298 #endif // BASE_NUMERICS_SAFE_MATH_H_ | 300 #endif // BASE_NUMERICS_SAFE_MATH_H_ |
OLD | NEW |