title: Calling an objects member function in a thread in main()
body: <p>I have found a lot about creating a new thread within a class (<a href="https://stackoverflow.com/questions/11057800/passing-member-functions-to-stdthread">Passing member functions to std::thread</a>)</p>
  
  <p>But is it somehow possible to do the following:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  
  using namespace std;
  
  class myClass
  {
  public:
      myClass(){
      myInt = 2;
      };
      void myFun(){
          ++myInt;
      }
      int ret_myInt(){
          return myInt;
      }
  
  private:
      int myInt;
  };
  
  int main ( void )
  {
      myClass myObj_;
      std::thread t1( myObj_.myFun );                 // (1)
      t1.join();
      cout &lt;&lt; myObj_.ret_myInt() &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>The Code is not working, because i cannot call a member function here (1). Is there a simple way to do that?</p>
  
  <p>To be clear: I don't want to create the thread inside the member function.</p>