title: inline functions and QObject::connect - expected expression
body: <p>I'm coming from Objective-C and love that inline functions have come to c++ in c++11, they're useful! Sadly though, I'm having a problem here with my slot (this setup reminds me of protocols and delegates a little bit, I am wondering if I could create a class specifically to behave like a "delegate" like in obj-c).</p>
  
  <pre><code>#include &lt;QCoreApplication&gt;
  #include &lt;QtNetwork/QTcpSocket&gt;
  
  int main(int argc, char *argv[])
  {
      QCoreApplication a(argc, argv);
  
      QTcpSocket *socket = new QTcpSocket;
      socket-&gt;connectToHost("qt.nokia.com", 80);
      QObject::connect(socket, &amp;QTcpSocket::connected, [socket, page] () {
          socket-&gt;write(QByteArray("GET " + "index.html" + "\r\n"));
      });
      QObject::connect(socket, &amp;QTcpSocket::readyRead, [socket] () {
          qDebug()&lt;&lt; "GOT DATA "&lt;&lt; socket-&gt;readAll();
      });
  
      return a.exec();
  
  }
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <pre><code>main.cpp:10: error: expected expression
  QObject::connect(socket, &amp;QTcpSocket::connected, [socket, page] () {
                               ^
  </code></pre>