FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
February 01, 1996

C++: Iterators

(Page 6 of 6)

February 1996/Standard C/C++: Iterators/Table 5

Table 5: Random-Access Iterator Additional Properties

Expression Result Type Meaning Notes
a < b convertible to bool b is reachable from a a and b in same domain
a > b convertible to bool b < a -
a <= b convertible to bool !(b < a) -
a >= b convertible to bool !(a < b) -
r += n X&
{ Dist m = n;
for (; 0 < m; --m)
  ++r;
for(; m < 0; ++m)
  --r;
return r; }
-
a + n
n + a
-
{X tmp =a ;
return tmp += n;}
-
r -= n X& r += -n -
a - n X a + -n -
b -a Dist
{ Dist m = 0;
for (; a < b; ++a)
  ++m;
for (; b < a; ++b)
  --m;
return m; }
a and b in same domain
a[n] convertible to T *(a + n) -


Notes: X is iterator type, a and b have type X, r and s have type X&
T is element type
Dist is distance type for X
all other properties same as for bidirectional iterators

Previous Page | 1 | 2 | 3 | 4 | 5 | 6
RELATED ARTICLES
No Related Articles
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK