 use lambda library
in this example.</p>
<pre class="literal-block">
int x[] = { 1, 2, 3, 4, 5, 6, 7, 8 };
const int N = sizeof(x)/sizeof(int);

typedef boost::binder1st&lt; std::multiplies&lt;int&gt; &gt; Function;
typedef boost::transform_iterator&lt;Function, int*&gt; doubling_iterator;

doubling_iterator i(x, boost::bind1st(std::multiplies&lt;int&gt;(), 2)),
  i_end(x + N, boost::bind1st(std::multiplies&lt;int&gt;(), 2));

std::cout &lt;&lt; &quot;multiplying the array by 2:&quot; &lt;&lt; std::endl;
wh