title: std::function<> and the Intel compiler version 11.1
body: <p>I'm having trouble working with lambda functions in the Intel compiler, in particular, the following code won't compile:</p>
  
  <pre><code>template&lt;typename T&gt;
  std::function&lt;T (int)&gt;  make_func(T x) {
    return [=](int index) -&gt; T
    {
       return x;
    };
  }
  </code></pre>
  
  <p>The error I get is </p>
  
  <pre><code>error: namespace "std" has no member "function"
  </code></pre>
  
  <p>The code compiles and runs fine on my Mac, (macports gcc version 4.5). The error is at work, where we use the Intel compiler version 11.1. It does accept lambda functions (with the -std=c++0x option), such as:</p>
  
  <pre><code>auto lam = [=](int j) -&gt; int {
      printf("testing for lambdas: %d\t%d\n", n, j);
      return n;
  };
  
  int g = lam(7);
  </code></pre>
  
  <p>The version of gcc installed at work is 4.1.2, so I'm guessing that the standard library is old? </p>
  
  <pre><code>/bin/libc.so.6
  </code></pre>
  
  <p>says it's version 2.5 compiled with gcc 4.1.2.</p>
  
  <p>Is there a way around this?</p>
  
  <p>thanks in advance for any help</p>