title: Is it bad that C++0x's lambda expressions don't have a named type?
body: <p>I've been reading a bit about lambda expressions on the internet recently and it seems to me that C++0x's lambda expressions will not have a single type (or types) that will bind exclusively to lambda expressions -- in other words, lambda expressions will only match template arguments or <code>auto</code> arguments/variables. What happens, as described <a href="http://software.intel.com/en-us/blogs/2009/08/03/hello-lambdas-c-0x-a-quick-guide-to-lambdas-in-c/" rel="noreferrer">here</a>, is that</p>
  
  <blockquote>
    <p>Compilers that support lambdas will
    create a unique anonymous functor type
    for each lambda expression</p>
  </blockquote>
  
  <p>My question is, is that a bad thing? Wouldn't it make sense to have some keyword that matches only to lambda expressions, e.g. <code>lambda</code>, which would work as follows</p>
  
  <pre><code>void f(std::function&lt;int(int)&gt; func)
  {
       func(2);
  }
  
  template&lt;typename T&gt;
  void g(T func)
  {
       func(2);
  }
  
  void h(lambda func)
  {
       func(2);
  }
  
  int main()
  {
      int fpointer(int);
      struct { int operator()(int var) { return var; } } functor;
  
      f(fpointer); //ok (actually a linker error, but for the sake of example)
      f(functor); //ok
      f([](int var) { return var; }); //ok
  
      g(fpointer); //ok
      g(functor); //ok
      g([](int var) { return var; }); //ok
  
      h(fpointer); //error -- function pointer isn't a lambda expr
      h(functor); //error -- functor isn't a lambda expr
      h([](int var) { return var; }); //ok
  
      return 0;
  }
  </code></pre>
  
  <p>To be honest, I actually can't see the usefulness of this (especially given that <code>auto</code> accepts lambda expressions, so one could then assign a lambda to a variable), but it still doesn't sit right with me that lambda expressions are anonymous types and cannot be bound specifically to just one particular type (to the exclusion of all others). </p>
  
  <p>In essence, my question is, is it fine that lambda expressions are anonymous (both in terms of utility -- does the lack of a <code>lambda</code> type devoid us of some functionality -- and philosophically -- does it really make sense that lambda expressions always have the 'type' <code>auto</code>)?</p>