Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/38998 )

Change subject: base: Remove begin() and end() from CircleBuf.
......................................................................

base: Remove begin() and end() from CircleBuf.

These functions return iterators which are inconsistent with the usage
model for this type. It should be accessed using the peek, push, and pop
methods and not iterators. If you need a class with iterators which is
oriented around accessing individual elements at a time, the
CircularQueue type is likely a better choice.

Change-Id: I9f37eab12e490b63d870d378a91f601dad353f25
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38998
Reviewed-by: Daniel Carvalho <oda...@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandb...@arm.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/base/circlebuf.hh
1 file changed, 0 insertions(+), 11 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved; Looks good to me, approved
  Daniel Carvalho: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/circlebuf.hh b/src/base/circlebuf.hh
index 0f1cea6..bcfa91a 100644
--- a/src/base/circlebuf.hh
+++ b/src/base/circlebuf.hh
@@ -62,8 +62,6 @@

   public:
     using value_type = T;
-    using iterator = typename std::vector<T>::iterator;
-    using const_iterator = typename std::vector<T>::const_iterator;

     explicit CircleBuf(size_t size) : buffer(size), maxSize(size) {}

@@ -71,15 +69,6 @@
     size_t size() const { return used; }
     size_t capacity() const { return maxSize; }

-    iterator begin() { return buffer.begin() + start % maxSize; }
- const_iterator begin() const { return buffer.begin() + start % maxSize; }
-    iterator end() { return buffer.begin() + (start + used) % maxSize; }
-    const_iterator
-    end() const
-    {
-        return buffer.begin() + (start + used) % maxSize;
-    }
-
     /**
      * Throw away any data in the buffer.
      */

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/38998
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I9f37eab12e490b63d870d378a91f601dad353f25
Gerrit-Change-Number: 38998
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to