How to use const_reference type to declare a variable and assign to it, the return value of front() function
<p>I declared a vector and initialized it with three values as,</p>

<pre><code>vector&lt;int&gt; vec{1, 2, 3};
</code></pre>

<p>I tried to assign the returned value of vec.front() to a reference variable, <code>a</code>.</p>

<p>How can I declare a using correct data type?</p>

<p>I tried,</p>

<pre><code>vector&lt;int&gt;::const_reference &amp;a = vec.front();           
</code></pre>

<p>but what does this statement mean?</p>

<p>Can I first declare the variable a using proper data type and then use</p>

<pre><code>a = vec.front();
</code></pre>

<p>to assign the returned value of vec.front() to the variable <code>a</code>? If yes, then what should I write?</p>