File: replace.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (38 lines) | stat: -rw-r--r-- 1,966 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
hi(replace) hi(replace_copy) hi(replace_copy_if) hi(replace_if)
    itemization(
        it() Header file: tt(<algorithm>)
        it() Function prototype:
        itemization(
            itt(void replace([ExecPol,] ForwardIterator first, 
    ForwardIterator last, Type const &oldvalue, Type const &newvalue);)
            itt(ForwardIterator replace_if([ExecPol,] ForwardIterator first,
    ForwardIterator last, UnaryPredicate pred, Type const &value);)
            itt(OutputIterator replace_copy([ExecPol,] InputIterator first, 
InputIterator last, OutputIterator result, Type const &oldvalue, 
Type const &newvalue);)
            itt(OutputIterator replace_copy_if([ExecPol,] 
ForwardIterator first, ForwardIterator last, OutputIterator result, 
UnaryPredicate pred, Type const &value);)
        )
        it() Description:
        itemization(
            it() The first predicate: all elements equal to tt(oldvalue) in
the range pointed to by rangett(first, last) are replaced by a copy of
tt(newvalue). The algorithm uses tt(operator==) of the data type to which the
iterators point.
            it() The second prototype: elements in the range pointed to by
rangett(first, last) for which the unary predicate tt(pred) evaluates as
tt(true) are replaced by tt(value).
            it() The third prototype: all elements equal to tt(oldvalue) in
the range pointed to by rangett(first, last) are sent to the tt(result) output
iterator, replacing elements equal to tt(oldValue) by tt(newValue), using
tt(operator==) of the data type to which the iterators point.
            it() The fourth prototype: the elements in the range pointed to by
rangett(first, last) for which the unary predicate tt(pred) returns tt(false)
are sent to the tt(result) output iterator, and tt(value) is sent to
tt(result) if tt(pred) returns tt(true). The range rangett(first, last) is not
modified.
        )
        it() Example:
        verbinclude(-a examples/replace.cc)
    )