Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Unified Diff: public/platform/WebVector.h

Issue 1014933002: Add begin()/end() to WebVector to enable range-based for loops (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move test to Source/platform/ Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebVector.h
diff --git a/public/platform/WebVector.h b/public/platform/WebVector.h
index e83a2d0d2cd56d627ae2b4d50fed0c0e3fcfa591..af76961b6d08c806c361e799d7267e5b74ae97c7 100644
--- a/public/platform/WebVector.h
+++ b/public/platform/WebVector.h
@@ -63,7 +63,9 @@ namespace blink {
template <typename T>
class WebVector {
public:
- typedef T ValueType;
+ using ValueType = T;
+ using iterator = T*;
+ using const_iterator = const T*;
~WebVector()
{
@@ -146,6 +148,11 @@ public:
T* data() { return m_ptr; }
const T* data() const { return m_ptr; }
+ iterator begin() { return data(); }
+ iterator end() { return begin() + m_size; }
+ const_iterator begin() const { return data(); }
+ const_iterator end() const { return begin() + m_size; }
+
void swap(WebVector<T>& other)
{
std::swap(m_ptr, other.m_ptr);
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698