ostream_iterator<T>(ostream, sep)
- T::operator <<()
must
be defined
istream_iterator<T>(istream)
- T::operator >>()
must be
defined
istream_iterator<T>()
- default constructor; eof
copy(istream_iterator<T>(istream), istream_iterator<T>(),
tvec.end())
doesn't work
*
and ++
back_insert_iterator(C)
creates an back-insert iterator for
container C
*back_insert_iterator(C) = v
is equivalent to
C.push_back(v)
copy(istream_iterator(cin), istream_iterator (), back_insert_iterator(svec));
C
must have the push_back()
member function
front_insert_iterator(C)
creates an front-insert iterator for
container C
*back_insert_iterator(C) = v
is equivalent to
C.push_front(v)
copy(istream_iterator(cin), istream_iterator (), front_insert_iterator(svec));
C
must have the push_front()
member
function
front_insert_iterator(C, i)
creates a insert iterator for
container C
starting at the iterator i
*insert_iterator(C, i) = v
is equivalent to
i = C.insert(v, i)
copy(istream_iterator(cin), istream_iterator (), insert_iterator(svec, svec.end()));
C
must have the insert()
member function
<
, =
, and so on
()
can also be defined for a class.
class callable { public: void operator()() { . . . } }; int f() { callable c; c(); }
template<class Arg,class Result>ptr_fun(Result (*x) (Arg))
-
converts x
, a pointer to a unary function, into a callable
function object
ptr_fun(isalnum)
template<class Arg1,class Arg2,class Result>ptr_fun(Result (*x)
(Arg1, Arg2))
- converts x
, a pointer to a binary function,
into a callable function object
ptr_fun(index)
not1
inverts the sense of a unary predicate
not1(ptr_fun(isalnum))
not2
inverts the sense of a binary predicate
not2(less<string>)
find_if()
accepts a unary prediate
bind1st(callable_object, first_argument)
- returns a unary
callable object
char * msg = "hello world!"; char * cp = find_if(msg, msg + strlen(msg), bind1st(ptr_fun(index), " \t\n"));
bind1st(callable_object, first_argument)
- returns a unary
callable object
char ** cp = find_if(argv, argv + argc, bind2nd(ptr_fun(index), '!'));
push()
(a.k.a. push_back()
,
pop()
, (a.k.a. pop_back()
, top()
(a.k.a. back()
,
size()
, and empty()
pop()
does not return the value popped
push_back()
, pop_back()
, or back()
functions
insert()
, erase()
, or []
operations
begin()
or end()
operator ==()
and operator <()
with the usual meanings
push_back()
, pop_back()
,
back()
, size()
, and empty()
can be the base
for a stack adaption - vector, dequeue, list
push()
(a.k.a. push_back()
,
pop()
, (a.k.a. pop_front()
, front()
, back()
,
size()
, and empty()
pop()
does not return the value popped
push_front()
or pop_back()
insert()
, erase()
, or []
operations
begin()
or end()
operator ==()
and operator <()
with the usual meanings
push_back()
, pop_front()
,
front()
, back()
, size()
, and empty()
can be the
base for a queue adaption - dequeue, list
push()
, pop()
, front()
,
back()
, size()
, and empty()
pop()
does not return the value popped
push_front()
or pop_back()
insert()
, erase()
, or []
operations
begin()
or end()
operator ==()
and operator <()
push_back()
, pop_front()
, front()
, back()
,
size()
, and empty()
can be the base for a queue adaption -
dequeue
This page last modified on 15 August 2000.