Table 2: Input Iterator Properties
Expression | Result Type | Meaning | Notes |
---|---|---|---|
X() | X | constructs a default value | destructor is visible value may be singular |
X u | X& | u has default value | - |
X(a) | X | constructs a copy of a | destructor is visible *X(a) has same effect as *a |
X u(a) X u = a |
X& | u is a copy of a | once constructed, u = = a |
r = a | X& | assigns a to r | result: r = = a |
a = = b | convertible to bool | compare for equivalence | a and b in same domain of values |
a != b | convertible to bool | !(a = = b) | - |
*a | T | access element from sequence | a was not "off the end" a = = b implies *a = = *b |
a->m | type of m | (*a).m | a has member m |
++r | X& | point to next element | r was not "off the end" &r = = &++r invalidates copies of r |
(void)r++ | void | (void)++r | - |
r++ | T |
{ T tmp = *r; ++r; return tmp;} |
- |
Notes: X is iterator type, a and b have type X, r has type X&
T is element type, t has type T