Gabriel B. has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/67454?usp=email )

 (

5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one. )Change subject: sim: Suppress deleted operator= warn in Sys::Threads::const_it
......................................................................

sim: Suppress deleted operator= warn in Sys::Threads::const_it

Swapping the reference member to threads for a pointer restores
trivial copiablity and movability.

Change-Id: I18d3a5b908d8575aef198f457b85060aa202bd5f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67454
Reviewed-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/sim/system.hh
1 file changed, 22 insertions(+), 9 deletions(-)

Approvals:
  Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/sim/system.hh b/src/sim/system.hh
index 1d179e9..d2725c3 100644
--- a/src/sim/system.hh
+++ b/src/sim/system.hh
@@ -152,19 +152,16 @@
         class const_iterator
         {
           private:
-            const Threads &threads;
+            Threads const* threads;
             int pos;

             friend class Threads;

             const_iterator(const Threads &_threads, int _pos) :
-                threads(_threads), pos(_pos)
+                threads(&_threads), pos(_pos)
             {}

           public:
-            const_iterator(const const_iterator &) = default;
-            const_iterator &operator = (const const_iterator &) = default;
-
             using iterator_category = std::forward_iterator_tag;
             using value_type = ThreadContext *;
             using difference_type = int;
@@ -181,16 +178,16 @@
             const_iterator
             operator ++ (int)
             {
-                return const_iterator(threads, pos++);
+                return const_iterator(*threads, pos++);
             }

-            reference operator * () { return threads.thread(pos).context; }
-            pointer operator -> () { return &threads.thread(pos).context; }
+ reference operator * () { return threads->thread(pos).context; } + pointer operator -> () { return &threads->thread(pos).context; }

             bool
             operator == (const const_iterator &other) const
             {
-                return &threads == &other.threads && pos == other.pos;
+                return threads == other.threads && pos == other.pos;
             }

             bool

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67454?usp=email 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: I18d3a5b908d8575aef198f457b85060aa202bd5f
Gerrit-Change-Number: 67454
Gerrit-PatchSet: 10
Gerrit-Owner: Gabriel B. <gabriel.bus...@arteris.com>
Gerrit-Reviewer: Gabriel B. <gabriel.bus...@arteris.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.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

Reply via email to