how to do deep copy with out operator = in class
<pre><code>struct Property 
{
    int objID;
    const char* objName;
};


struct Data
{
    Property propertyRef;
}

std::vector&lt;Data&gt; items;
</code></pre>

<p>Here one of the function I am assigning data as follows</p>

<pre><code>Data d1;
d1.propertyRef.objID = 1;
d1.propertyRef.objName = "MyObj";

//... I am some logic in between and passing this d2 which is mentioned below to another thread in argument

Data d2 = d1;
</code></pre>

<p>Problem is that when I print <code>d2.propertyRef.objName</code> it is printing junk value? </p>

<p>Point here is that I am using library and I cannot change library to add operator = in Data.</p>

<p>Why I am facing this problem and how to solve it? (I googled it, mentioned that I have to deep copy and I am not sure how to d that for vector.</p>
