Stl Quick Reference Card Page 6

ADVERTISEMENT

6
STL Quick Reference – Version 1.29
April 20, 2007
[A4]
peration
5.1
Function Adaptors
6.2
Stream Iterators
template class
In table follows requirements check list for
O
binder2nd
Input, Output and Forward iterators.
class
: public
unary function
5.1.1
Negators
Expression; Requirements
I O F
peration
::first argument type,
O
might be singular
peration
X()
template class
,
T
::result type ;
redicate
O
X u
istance
template class
P
class
=ptrdiff t
D
X(a)
X(a) == a
binder2nd
unary negate
binder2nd::
(
class
: public
class
istream iterator
:
peration
redicate
istance
*a=t
*X(a)=t
const
&
op,
unary function
::argument type,
O
P
pubic iterator input iterator tag,
,
;
peration
T
D
X u(a)
u == a
const
bool ;
::second argument type
y);
O
X u=a
argument type from unary function
u copy of a
peration
unary negate
unary negate::
(
end of stream
7.4
redicate
::result type
O
equivalence relation
a==b
istream iterator
pred);
istream iterator::
();
P
operator()
binder2nd::
(
a!=b
!(a==b)
bool
negate pred
const
binder2nd::argument type x);
r = a
r == a
istream iterator
istream iterator::
(
peration
operator()
unary negate::
(
redicate
istream& s);
7.4
binder2nd
*a
convertible to T.
O
peration
::argument type x);
P
a==b
*a==*b
bind2nd
(
const
& op,
const
& x);
O
T
redicate
istream iterator
istream iterator::
(
*a=t
(for forward, if X mutable)
unary negate
P
7.7.
istance
redicate
const
istream iterator
,
&);
result is dereferenceable or
T
D
++r
not1
const
(
pred);
P
past-the-end. &r == &++r
5.1.3
Pointers to Functions
redicate
istream iterator
convertible to const X&
istream iterator::~
();
template class
P
rg
esult
convertible to X&
template class
, class
binary negate
A
R
class
: public
operator *
const
& istream iterator::
()
const
;
r==s
++r==++s
T
pointer to unary function
class
:
binary function
rg
esult
redicate
convertible to X&
r++
public unary function
,
;
A
R
::first argument type,
P
istream iterator&
Read and store
value
redicate
X x=r;++r;return x;
T
rg
esult
::second argument type ;
P
istream iterator::
operator
+ +
()
const
;
convertible to T
*++r
pointer to unary function
,
A
R
esult
rg
bool ;
*r++
ptr fun
(
(*x)(
));
R
A
bool
all end-of-streams are equal
7.7.
rg
rg
operator
= =
const
binary negate
(
istream iterator,
binary negate::
(
redicate
template class
1, class
2,
A
A
const
istream iterator);
esult
pred);
P
class
6.1.2
Bidirectional Iterators
R
pointer to binary function
bool
negate pred
class
:
rg
rg
operator()
struct bidirectional iterator tag
binary negate::
(
public binary function
1,
2,
A
A
redicate
esult
template class
T
::first argument type
x
;
P
R
The forward requirements and:
redicate
class
ostream iterator
:
rg
rg
::second argument type
y);
P
const
--r Convertible to
X&. If
r=++s then
pointer to binary function
1,
2,
public iterator output iterator tag, void, . . . ;
A
A
redicate
esult
--r refers same as s. &r==&--r.
binary negate
P
R
redicate
esult
rg
rg
--(++r)==r. (--r == --s
r==s.
not2
(
const
pred);
P
ptr fun
(
(*x)(
1,
2));
R
A
A
If delim = 0 add after each write
X x=r; --r; return x; .
r--
ostream iterator
ostream iterator::
(
5.1.2
Binders
6
Iterators
ostream&
s,
6.1.3
Random Access Iterator
peration
const
char *
delim=0);
struct random access iterator tag
template class
O
#include
iterator
class
binder1st
: public
The bidirectional requirements and
ostream iterator
ostream iterator::
(
unary function
(m,n iterator’s distance (integral) value):
6.1
Iterators Categories
const
ostream iterator s);
peration
::second argument type,
O
peration
r+=n
for (m=n; m-->0; ++r);
ostream iterator&
Assign & write (*o=t)
::result type ;
Here, we will use:
O
for (m=n; m++<0; --r);
operator *
const
ostream iterator::
()
;
X iterator type.
but time =
(1).
return r;
binder1st
binder1st::
(
peration
a, b iterator values.
a+n
n+a
X x=a; return a+=n]
ostream iterator&
const
&
op,
O
operator
=
peration
ostream iterator::
(
r iterator reference (X& r).
r-=n
r += -n.
const
::first argument type
y);
O
const
ostream iterator s);
t a value type T.
a-n
a+(-n).
b-a Returns iterator’s distance value , such
argument type from unary function
Imposed by empty struct tags.
peration
ostream iterator&
No-op
that a+n == b.
::result type
O
operator
ostream iterator::
+ +
();
a[n]
*(a+n).
binder1st::
operator()
(
6.1.1
Input, Output, Forward
a<b Convertible to bool, < total ordering.
const
ostream iterator&
No-op
binder1st::argument type x);
a<b Convertible to bool, > opposite to <.
peration
ostream iterator::
operator
+ +
(int);
struct input iterator tag
7.8
binder1st
a<=b
!(a>b).
O
struct output iterator tag
peration
bind1st
const
const
(
& op,
& x);
struct forward iterator tag
a>=b
!(a<b).
7.4.
O
T
Yotam Medini c 1998-2007

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 8