![]() |
Output Iterator Adaptors adapt the behavior of the underlying Output
Iterator. An Output Iterator Adaptor is a Pipable
Function Object, so that, by using operator|=
, you can "chain" multiple adaptors:
int const in[] = { 1,2,3,4,5,6,7,8,9,10 }; int const answer[] = {2*3,4*3,6*3,8*3,10*3}; std::vector<int> out; copy(in, filterer(regular(bll::_1 % 2 == 0)) |= transformer(regular(bll::_1 * 3)) |= std::back_inserter(out) ); BOOST_CHECK( equals(out, answer) );
converter
changes an output
into specified type.
<pstade/oven/converter.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> *_outit++ = boost::implicit_cast<To>(v)
.
Valid expression |
Semantics |
---|---|
|
A Major Function Object type |
|
|
|
|
|
A Pipable Function Object type |
|
|
copier
outputs to another
output iterator.
<pstade/oven/copier.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> *_outit0++ = v;
*_outit++ = v
.
Valid expression |
Semantics |
---|---|
|
|
std::vector<int> v1, v2, v3; int b[] = {1,3,4,5,3,2,5,1,2}; copy(b, copier(std::back_inserter(v1)) |= copier(std::back_inserter(v2)) |= std::back_inserter(v3) );
filterer
skips an input which
doesn't satify a predicate.
<pstade/oven/filterer.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> if(_prd(*v))
*_outit++ = *v
.
Valid expression |
Semantics |
---|---|
|
|
_prd
is Assignable.
indirecter
applies an extra
dereference in outputting.
<pstade/oven/indirecter.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> *_outit++ = *v
.
Valid expression |
Semantics |
---|---|
|
|
intercepter
intercepts inputs.
<pstade/oven/intercepter.hpp>
Valid expression |
Semantics |
---|---|
|
|
|
|
permuter
outputs permuted
values using inputs as indices of a range.
<pstade/oven/permuter.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> *_outit++ = *(_begin(_rndrng)+v)
.
Valid expression |
Semantics |
---|---|
|
|
tranformer
applies a Function Object to
an input.
<pstade/oven/transformer.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> *_outit++ = _fun(v)
.
Valid expression |
Semantics |
---|---|
|
|
_fun
is Assignable.
range_transformer
can turn
a Range Adaptor into Output Iterator Adaptor.
<pstade/oven/range_transformer.hpp>
f_
is an imaginary Function Object
which behaves as if it were v
-> _outit
= copy(_fun(single(v)),
_outit)
.
Valid expression |
Semantics |
---|---|
|
|
_fun
is Assignable.
file_range<boost::uint8_t> frng("utf8.txt"); std::vector<boost::uint8_t> result; // Do the same job as utf8_encoder slightly inefficient way. copy(frng|utf8_decoded, range_transformer(make_utf8_encoded) |= std::back_inserter(result));
Pending...
<pstade/oven/utf8_encoder.hpp>
Valid expression |
Semantics |
---|---|
|
|
T
is boost::utf8_output_iterator<typeof(_outit)>
such that T(_outit)
is a valid expression.
Pending...
<pstade/oven/utf16_encoder.hpp>
Valid expression |
Semantics |
---|---|
|
|
T
is boost::utf16_output_iterator<typeof(_outit)>
such that T(_outit)
is a valid expression.
Copyright © 2005 -2007 Shunsuke Sogame |