How to make thread run existing class´ function? c++ : <p>I have an existing class with an function</p>

<pre><code>void Foo::startSimulation(std::string system_cmd)
{
        //Calling a simulation script from system
        //After simulation, there is nothing to do. 
        //Thread self-terminates.
}
</code></pre>

<p>My goal is to make a thread which runs the Foo function. 
I have tried <code>std::thread thread1(myFoo.startSimulation(message);</code> However this returns </p>

<pre><code>: error: no matching constructor for initialization of 'std::thread'
candidate constructor not viable: cannot convert argument of incomplete type 'void' to 'const std::__1::thread'
</code></pre>

<p>So my function returns void which the thread can´t run. How can I make the thread exist, and then run the processes the class function would do within that thread.</p>

<p>Is it in any way possible to make the thread. </p>

<pre><code>std::thread thread1; // Creating the thread
thread1.start(myFoo.startSimulation("system cmd");
thread1.detach();
</code></pre>

<p><strong>I know the above three lines of code are not working code in c++. std::thread has no .start() function.</strong></p>

<p><em>However, is there a way to make threads behave in that way?</em></p>
