1 // Copyright 2018 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_CONTAINERS_UTIL_H_ 6 #define BASE_CONTAINERS_UTIL_H_ 7 8 #include <stdint.h> 9 10 namespace base { 11 12 // TODO(crbug.com/817982): What we really need is for checked_math.h to be 13 // able to do checked arithmetic on pointers. 14 template <typename T> get_uintptr(const T * t)15inline uintptr_t get_uintptr(const T* t) { 16 return reinterpret_cast<uintptr_t>(t); 17 } 18 19 } // namespace base 20 21 #endif // BASE_CONTAINERS_UTIL_H_ 22