summaryrefslogtreecommitdiff
path: root/chromium/base/memory/raw_ptr.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/base/memory/raw_ptr.h')
-rw-r--r--chromium/base/memory/raw_ptr.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/chromium/base/memory/raw_ptr.h b/chromium/base/memory/raw_ptr.h
index 251d06f810d..be47b530dee 100644
--- a/chromium/base/memory/raw_ptr.h
+++ b/chromium/base/memory/raw_ptr.h
@@ -611,6 +611,15 @@ class TRIVIAL_ABI raw_ptr {
return *this += -delta_elems;
}
+ template<typename U, typename = std::enable_if_t<std::is_integral<U>::value>>
+ RAW_PTR_FUNC_ATTRIBUTES T* operator+(U delta_elems) const {
+ return get() + delta_elems;
+ }
+ template<typename U, typename = std::enable_if_t<std::is_integral<U>::value>>
+ RAW_PTR_FUNC_ATTRIBUTES T* operator-(U delta_elems) const {
+ return get() - delta_elems;
+ }
+
// Comparison operators between raw_ptr and raw_ptr<U>/U*/std::nullptr_t.
// Strictly speaking, it is not necessary to provide these: the compiler can
// use the conversion operator implicitly to allow comparisons to fall back to