xref: /aosp_15_r20/external/cronet/base/containers/util.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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)15 inline 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