title: C++14: Generic lambda with generic std::function as class member
body: <p>Consider this pseudo-snippet:</p>
  
  <pre><code>class SomeClass
  {
  public:
      SomeClass()
      {
          if(true)
          {
              fooCall = [](auto a){ cout &lt;&lt; a.sayHello(); };
          }
          else
          {
              fooCall = [](auto b){ cout &lt;&lt; b.sayHello(); };
          }
      }
  private:
      template&lt;typename T&gt;
      std::function&lt;void(T)&gt; fooCall;
  };
  </code></pre>
  
  <p>What I want is a class member <code>fooCall</code> which stores a generic lambda, which in turn is assigned in the constructor.</p>
  
  <p>The compiler complains that <code>fooCall</code> cannot be a templated data member.</p>
  
  <p>Is there any simple solution on how i can store generic lambdas in a class?</p>