 <pre><code>struct C { A a; B b; C(double ta[2], vector&lt;double&gt; tb) { a = A(ta[0],ta[1]); // or a.x = ta[0]; a.y = ta[1] b = tb; } }; </code></pre> <p>then you can initialize with something like</p> <pre><code>C c = C( {0.0, 0.1} , vector&lt;double&gt; bb(0.0,5) ); </code></pre>