title: How to use bind1st and bind2nd?
body: <p>I would like to learn how to use binding functions.
  Here is the idea:
  I have this function which takes to parameters:</p>
  
  <pre><code>void print_i(int t, std::string separator)
  {
          std::cout &lt;&lt; t &lt;&lt; separator;
  }
  </code></pre>
  
  <p>And I would like to do:</p>
  
  <pre><code>std::vector&lt;int&gt; elements;
  // ...
  for_each(elements.begin(), elements.end(), std::bind2nd(print_i, '\n'));
  </code></pre>
  
  <p>But it does not work !</p>
  
  <p>Here is what I get:</p>
  
  <pre><code>/usr/include/c++/4.3/backward/binders.h: In instantiation of ‘std::binder2nd&lt;void ()(int, std::string)&gt;’:
  main.cpp:72:   instantiated from here
  /usr/include/c++/4.3/backward/binders.h:138: error: ‘void ()(int, std::string)’ is not a class, struct, or union type
  /usr/include/c++/4.3/backward/binders.h:141: error: ‘void ()(int, std::string)’ is not a class, struct, or union type
  /usr/include/c++/4.3/backward/binders.h:145: error: ‘void ()(int, std::string)’ is not a class, struct, or union type
  /usr/include/c++/4.3/backward/binders.h:149: error: ‘void ()(int, std::string)’ is not a class, struct, or union type
  /usr/include/c++/4.3/backward/binders.h:155: error: ‘void ()(int, std::string)’ is not a class, struct, or union type
  /usr/include/c++/4.3/backward/binders.h:140: error: field ‘std::binder2nd&lt;void ()(int, std::string)&gt;::op’ invalidly declared function type
  /usr/include/c++/4.3/backward/binders.h: In function ‘std::binder2nd&lt;_Operation&gt; std::bind2nd(const _Operation&amp;, const _Tp&amp;) [with _Operation = void ()(int, std::string), _Tp = char]’:
  main.cpp:72:   instantiated from here
  /usr/include/c++/4.3/backward/binders.h:164: error: ‘void ()(int, std::string)’ is not a class, struct, or union type
  /usr/include/c++/4.3/bits/stl_algo.h: In function ‘_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int, std::allocator&lt;int&gt; &gt; &gt;, _Funct = std::binder2nd&lt;void ()(int, std::string)&gt;]’:
  main.cpp:72:   instantiated from here
  /usr/include/c++/4.3/bits/stl_algo.h:3791: error: no match for call to ‘(std::binder2nd&lt;void ()(int, std::string)&gt;) (int&amp;)’
  make: *** [all] Error 1
  </code></pre>
  
  <p>I could use functor, but it is quicker to use binding.</p>
  
  <p>Thanks!</p>