title: Using std::vector<boost::function> with boost::bind
body: <p>While trying to get comfortable with <code>boost</code>, stumbled into problem with using <code>boost::function</code> along with <code>std::vector</code>. I'm trying to do a simple thing: have a list of functions with similair signatures and then use all that functions with <code>std::for_each</code> on sample data. Here is the code:</p>
  
  <pre><code>typedef boost::function&lt;int (const char*)&gt; text_processor;
  typedef std::vector&lt;text_processor&gt; text_processors;
  text_processors processors;
  processors.push_back(std::atoi);
  processors.push_back(std::strlen);
  
  const char data[] = "123";
  
  std::for_each(processors.begin(), processors.end(),
      std::cout &lt;&lt; boost::bind(&amp;text_processors::value_type::operator(), _1, data) 
                &lt;&lt; "\n"
  );
  </code></pre>
  
  <p>So, with <code>for_each</code> I'm trying to write to standard output the result of applying every function to sample data. But it won't compile like this (some long message about missing operator <code>&lt;&lt;</code> for <code>bind</code> result). </p>
  
  <p>If I remove stream operators then I'll have compilable, but useless code. The trick is that I want to do function applying and text output in single <code>for_each</code>. What am I missing? Thought it should be easy with lambdas or smth like that, but can't figure out the correct solution.</p>