X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libs%2Frange%2Fdoc%2Freference%2Fadaptors%2Ftransformed.qbk;h=0c71e8d89e9de8f33b430624a4048c536ecc2ad0;hb=08c1e93fa36a49f49325a07fe91ff92c964c2b6c;hp=ec19583ee245edc75a98162d7c9dda55731ad4f8;hpb=bb4dd8289b351fae6b55e303f189127a394a1edd;p=platform%2Fupstream%2Fboost.git diff --git a/libs/range/doc/reference/adaptors/transformed.qbk b/libs/range/doc/reference/adaptors/transformed.qbk index ec19583..0c71e8d 100644 --- a/libs/range/doc/reference/adaptors/transformed.qbk +++ b/libs/range/doc/reference/adaptors/transformed.qbk @@ -15,44 +15,17 @@ * [*Postcondition:] For all elements `x` in the returned range, `x` is the result of `fun(y)` where `y` is the corresponding element in the original range. * [*Throws:] Whatever the copy-constructor of `fun` might throw. * [*Range Category:] __single_pass_range__ -* [*Range Return Type:] `boost::transformed_range` +* [*Range Return Type:] `boost::transformed_range` * [*Returned Range Category:] The range category of `rng`. [section:transformed_example transformed example] -`` -#include -#include -#include -#include -#include -#include - -struct double_int -{ - typedef int result_type; - int operator()(int x) const { return x * 2; } -}; - -int main(int argc, const char* argv[]) -{ - using namespace boost::adaptors; - using namespace boost::assign; - - std::vector input; - input += 1,2,3,4,5,6,7,8,9,10; - - boost::copy( - input | transformed(double_int()), - std::ostream_iterator(std::cout, ",")); - - return 0; -} -`` +[import ../../../test/adaptor_test/transformed_example.cpp] +[transformed_example] [endsect] This would produce the output: `` -2,4,6,8,10,12,14,16,18,20 +2,4,6,8,10,12,14,16,18,20, `` [endsect]