| 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_CONVERSIONS_H_ | 5 #ifndef BASE_NUMERICS_SAFE_CONVERSIONS_H_ |
| 6 #define BASE_NUMERICS_SAFE_CONVERSIONS_H_ | 6 #define BASE_NUMERICS_SAFE_CONVERSIONS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <cassert> | |
| 11 #include <limits> | 10 #include <limits> |
| 12 #include <ostream> | 11 #include <ostream> |
| 13 #include <type_traits> | 12 #include <type_traits> |
| 14 | 13 |
| 15 #include "base/numerics/safe_conversions_impl.h" | 14 #include "base/numerics/safe_conversions_impl.h" |
| 16 | 15 |
| 17 namespace base { | 16 namespace base { |
| 18 | 17 |
| 19 // The following are helper constexpr template functions and classes for safely | 18 // The following are helper constexpr template functions and classes for safely |
| 20 // performing a range of conversions, assignments, and tests: | 19 // performing a range of conversions, assignments, and tests: |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 using internal::saturated_cast; | 281 using internal::saturated_cast; |
| 283 using internal::StrictNumeric; | 282 using internal::StrictNumeric; |
| 284 using internal::MakeStrictNum; | 283 using internal::MakeStrictNum; |
| 285 | 284 |
| 286 // Explicitly make a shorter size_t alias for convenience. | 285 // Explicitly make a shorter size_t alias for convenience. |
| 287 using SizeT = StrictNumeric<size_t>; | 286 using SizeT = StrictNumeric<size_t>; |
| 288 | 287 |
| 289 } // namespace base | 288 } // namespace base |
| 290 | 289 |
| 291 #endif // BASE_NUMERICS_SAFE_CONVERSIONS_H_ | 290 #endif // BASE_NUMERICS_SAFE_CONVERSIONS_H_ |
| OLD | NEW |