initialize a member variable inside of constructor? (this should be very basic...)
<p>Edit: I need to refactor this question, it has too many extraneous components to be clear what my question (which is about C++) is. But anyone who can understand what I am asking please do answer.</p>

<p>I have a class which represents a thread. The threading library I am using, TinyThread++, starts a thread by creating a <code>thread</code> object, however there is no copy constructor for it. Which makes sense.. What would be the meaning of copying a thread anyway?</p>

<p>Previously I had been initializing my thread object <code>E_thread</code> this way: </p>

<pre><code>class E_thread {
    E_threadRoutine m_routine;
    E_thread *m_parent;
    thread m_thread;
public:
    E_thread(void *(void*),void*,E_thread*);
};
E_thread::E_thread(void *func(void*), void *arg, E_thread* parent): 
         m_parent(parent), m_routine(func,arg), 
         m_thread(thread_function_common, &amp;m_routine) 
         {}
</code></pre>

<p>Initializing the <code>thread</code> ctor in this fashion works, I am sending the pointer of the <code>E_thread</code>'s <code>m_routine</code> member to the thread as its argument. The purpose of <code>m_routine</code> is to keep track of thread specific functionality to pass to the thread itself. </p>

<p>However now I want to make a change where I want to allocate <code>m_routine</code> more carefully. Now <code>m_routine</code> is a pointer and I will need to set it with </p>

<pre><code>m_routine = new E_threadRoutineTypeX(func,arg,etc);
</code></pre>

<p>in the <code>E_thread</code> ctor body. But this means I can no longer initialize <code>thread</code> the way I have been. I tried putting </p>

<pre><code>m_thread = thread(thread_function_common,m_routine);
</code></pre>

<p>in the body but this copies the thread object which I don't want to do. There's gotta be some syntax for doing this....</p>
