title: Why am i getting a "In instantiation of ‘struct std::_Bind_simple<Fctor()>’ " error
body: <p>I'm just getting started with multi-threading in <code>C++ 11</code> and I stumbled upon an error that I do not understand.</p>
  
  <p>This is my <code>multi1.cpp</code> file:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  using namespace std;
  class Fctor {
  public:
      void operator() (string msg) {
          std :: cout  &lt;&lt; "From Fctor: "&lt;&lt; msg &lt;&lt; std :: endl;
      }
  };
  
  int main()
  {
      string s = "Hello world";
      std::thread t1((Fctor()),s);
  
      t1.join();
      return 0;
  }
  </code></pre>
  
  <p>Now I try to run this file in a <code>cygwin</code> environment using the following command:</p>
  
  <pre><code>$ g++ -std=c++11 multi1.cpp -o output
  </code></pre>
  
  <p>This leads to an error in compilation that prints:</p>
  
  <pre><code>In file included from /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/include/c++/thread:39:0,
                   from multi1.cpp:2:
  /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/include/c++/functional: In instantiation of ‘struct std::_Bind_simple&lt;Fctor()&gt;’:
  /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/include/c++/thread:137:47:   required from ‘std::thread::thread(_Callable&amp;&amp;, _Args&amp;&amp; ...) [with _Callable = Fctor&amp;; _Args = {}]’
  multi1.cpp:15:19:   required from here
  /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/include/c++/functional:1665:61: error: no type named ‘type’ in ‘class std::result_of&lt;Fctor()&gt;’
         typedef typename result_of&lt;_Callable(_Args...)&gt;::type result_type;
                                                               ^
  /usr/lib/gcc/x86_64-pc-cygwin/4.9.3/include/c++/functional:1695:9: error: no type named ‘type’ in ‘class std::result_of&lt;Fctor()&gt;’
           _M_invoke(_Index_tuple&lt;_Indices...&gt;)
  </code></pre>
  
  <p>I cannot comprehend what the compiler is trying to tell me. I am trying to understand how things work while I go through the <a href="https://www.youtube.com/watch?v=f2nMqNj7vxE&amp;index=2&amp;list=PL5jc9xFGsL8E12so1wlMS0r0hTQoJL74M" rel="nofollow">C++ multithreading tutorial</a> on YouTube by Bo Qian.</p>
  
  <p>Thanks in advance guys.</p>