From 6058efdbdc186e120e7e2121c290ac4d820ffbf8 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 6 Apr 2018 23:48:24 +0000 Subject: Add span.h from chromium base. Allows indexing with better bounds-checking to occur. Some small modifications are required to deal with PDFium being intentionally held at C++11 compliance, not C++14. Use in one place as check on correctness. Change-Id: Id2875cf0a93980112bc536a93c4f9ec5306c0dac Reviewed-on: https://pdfium-review.googlesource.com/29671 Commit-Queue: Tom Sepez Reviewed-by: Chris Palmer Reviewed-by: dsinclair --- core/fxcrt/unowned_ptr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fxcrt') diff --git a/core/fxcrt/unowned_ptr.h b/core/fxcrt/unowned_ptr.h index f9753cde37..b1c9c66b3e 100644 --- a/core/fxcrt/unowned_ptr.h +++ b/core/fxcrt/unowned_ptr.h @@ -32,7 +32,8 @@ // // The array indexing operation [] is not supported on an unowned ptr, // because an unowned ptr expresses a one to one relationship with some -// other heap object. +// other heap object. Use pdfium::span<> for the cases where indexing +// into an unowned array is desired, which performs the same checks. namespace fxcrt { -- cgit v1.2.3