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

Unified Diff: webrtc/base/buffer.h

Issue 2804673002: Add [c]begin() and [c]end() member functions to rtc::Buffer (Closed)
Patch Set: Remove redundant "this->" Created 3 years, 8 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 | « no previous file | webrtc/base/buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/buffer.h
diff --git a/webrtc/base/buffer.h b/webrtc/base/buffer.h
index 44f941eb60b2bb1016874d6f94bbda52a759f10a..85e6efb74e432f8229d43532671198eeccc2adcd 100644
--- a/webrtc/base/buffer.h
+++ b/webrtc/base/buffer.h
@@ -179,6 +179,13 @@ class BufferT {
return data()[index];
}
+ T* begin() { return data(); }
+ T* end() { return data() + size(); }
+ const T* begin() const { return data(); }
+ const T* end() const { return data() + size(); }
+ const T* cbegin() const { return data(); }
+ const T* cend() const { return data() + size(); }
+
// The SetData functions replace the contents of the buffer. They accept the
// same input types as the constructors.
template <typename U,
« no previous file with comments | « no previous file | webrtc/base/buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698