@@ -45,7 +45,7 @@ namespace concurrent_collections
4545 // for the first time on the background thread.
4646 enum class collection_action
4747 {
48- none, push_back, insert, erase, at, lookup
48+ none, push_back, insert, erase, at, lookup, advance
4949 };
5050
5151 // All of our concurrency tests consists of starting an
@@ -165,36 +165,46 @@ namespace concurrent_collections
165165 return owner->dereference_iterator (inner ());
166166 }
167167
168- // inherited: pointer operator->() const;
168+ pointer operator ->() const
169+ {
170+ auto guard = owner->lock_const ();
171+ owner->call_hook (collection_action::at);
172+ return iterator::operator ->();
173+ }
169174
170175 concurrency_checked_random_access_iterator& operator ++()
171176 {
177+ owner->call_hook (collection_action::advance);
172178 ++inner ();
173179 return *this ;
174180 }
175181
176182 concurrency_checked_random_access_iterator& operator ++(int )
177183 {
184+ owner->call_hook (collection_action::advance);
178185 auto prev = *this ;
179186 ++inner ();
180187 return prev;
181188 }
182189
183190 concurrency_checked_random_access_iterator& operator --()
184191 {
192+ owner->call_hook (collection_action::advance);
185193 --inner ();
186194 return *this ;
187195 }
188196
189197 concurrency_checked_random_access_iterator& operator --(int )
190198 {
199+ owner->call_hook (collection_action::advance);
191200 auto prev = *this ;
192201 --inner ();
193202 return prev;
194203 }
195204
196205 concurrency_checked_random_access_iterator& operator +=(difference_type offset)
197206 {
207+ owner->call_hook (collection_action::advance);
198208 inner () += offset;
199209 return *this ;
200210 }
@@ -206,6 +216,7 @@ namespace concurrent_collections
206216
207217 concurrency_checked_random_access_iterator& operator -=(difference_type offset)
208218 {
219+ owner->call_hook (collection_action::advance);
209220 inner () -= offset;
210221 return *this ;
211222 }
0 commit comments