title: How to use std::bind
body: <p>I'm trying to implement the std::bind in an easy example:</p>
  
  <pre><code>#include &lt;functional&gt;
  #include &lt;iostream&gt;
  using namespace std;
  using namespace std::placeholders;
  int multiply(int a, int b)
  {
      return a * b;
  }
  int main()
  {
      auto f = bind(multiply, 5, _1);
      for (int i = 0; i &lt; 10; i++)
      {
          cout &lt;&lt; "5 * " &lt;&lt; i &lt;&lt; " = " &lt;&lt; f(i) &lt;&lt; endl;
       }
      return 0;
  }
  </code></pre>
  
  <p>however, when I compile this is what I get:</p>
  
  <pre><code>test.cpp:5: error: ‘placeholders’ is not a namespace-name
  test.cpp:5: error: expected namespace-name before ‘;’ token
  test.cpp: In function ‘int main()’:
  test.cpp:14: error: ISO C++ forbids declaration of ‘f’ with no type
  test.cpp:14: error: ‘_1’ was not declared in this scope
  test.cpp:14: error: ‘bind’ was not declared in this scope
  test.cpp:17: error: ‘f’ cannot be used as a function
  </code></pre>
  
  <p>awkward when a given example returns compilation errors o.O</p>
  
  <p>thank you in advance for your help</p>