-1

I am looking at the following line of code

++ptr_it->refcount;

where ptr_it is an iterator for a list of a particular class where refcount is an integer member variable. I can't figure out whether the ++ operator here is being used to go to the next element of the list in the ptr_it or if it is being used to increment the refcount variable. Or maybe both? I figure that refcount must be affected in some way otherwise I'm not sure why it is dereferenced here. Can anyone tell me what is actually happening here.

Mat
  • 202,337
  • 40
  • 393
  • 406
user1893354
  • 5,778
  • 12
  • 46
  • 83

1 Answers1

0

In the statement

++ptr_it->refcount;

the variable being incremented is refcount. There's no ambiguity and no way that more than one thing would be incremented.

Jesper Juhl
  • 30,449
  • 3
  • 47
  • 70