Add numeric_cast for checked integral narrowing casts
In work on bringing up Windows x64, there are many places that need to be safely narrowed to the types used for interacting with other APIs (particularly when using containers). Rather than scatter these CHECKs all over, numeric_cast<> CHECKs that the runtime value can be safely converted to the target type. BUG=8606, 167187, 166496 Review URL: https://codereview.chromium.org/11886037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177264 0039d316-1c4b-4281-b951-d872f2087c98
Showing
base/safe_numerics.h
0 → 100644
Please register or sign in to comment