different types of initialization in C++
<p>I'm learning C++, and am rather confused as to the different types of initialization.</p>

<p>You can do:</p>

<pre><code>T a;
</code></pre>

<p>which, as far as I can tell, will sometimes initialize <code>a</code> and sometimes won't, depending on if <code>T</code> has a default constructor.</p>

<p>You can also do:</p>

<pre><code>T a(); // or
T a(1, 2, 3... args);
</code></pre>

<p>; (in some cases):</p>

<pre><code>T a = 1; // implicitly converted to T sometimes?
</code></pre>

<p>; if there is no constructor:</p>

<pre><code>T a = {1, 2, 3, 4, 5, 6};
</code></pre>

<p>; and also:</p>

<pre><code>T a = T(1, 2, 3);
</code></pre>

<p>.</p>

<p>If you want to allocate on the heap, there's</p>

<pre><code>T a = new T(1, 2, 3);
</code></pre>

<p>Is there anything else?</p>

<p>I'd like to know if a) I've got all the types of initialization covered and b) when to use each type?</p>
