What does the &
after a method signature mean and do? I have this:
Iterator operator++(int) &
in my iterator types but I do not recall why I had to put it there (only that it fixed the problem I had a while back). Strangely I cannot find much about it but it is most likely because I do not know how it is actually called.
A bonus question but is it part of the signature? If yes, how does the pointer to this method look like (where does the &
go)?
EDIT: To answer the bonus question: It is part of the signature (and can be overload). Having ref-qualified signature means you cannot have non-ref qualified one though. And the pointer would be: Iterator(Iterator::*ptr)(int) & = &Iterator::operator++;