Trouble with vector.insert()
<p>I'm trying to insert an element in a vector but it seems I'm doing something wrong.</p>

<p>Here's where I declare the vector:</p>

<p><code>std::vector&lt;Dice&gt; dicearray;</code></p>

<p>This is the line that throws the errors:</p>

<p><code>dicearray.insert(dicearray.size()-1 ,Dice());</code></p>

<p>And these are the error that are thrown:</p>

<p><code>Error (active)     no instance of overloaded function "std::vector&lt;_Ty, _Alloc&gt;::insert [with _Ty=Dice, _Alloc=std::allocator&lt;Dice&gt;]" matches the argument list    ConsoleApplication3 c:\Users\Miguel\Documents\Visual Studio 2015\Projects\ConsoleApplication3\ConsoleApplication3\ConsoleApplication3.cpp   60</code></p>

<p>and</p>

<p><code>Error  C2664   'std::_Vector_iterator&lt;std::_Vector_val&lt;std::_Simple_types&lt;Dice&gt;&gt;&gt; std::vector&lt;Dice,std::allocator&lt;_Ty&gt;&gt;::insert(std::_Vector_const_iterator&lt;std::_Vector_val&lt;std::_Simple_types&lt;Dice&gt;&gt;&gt;,unsigned int,const _Ty &amp;)': cannot convert argument 1 from 'unsigned int' to 'std::_Vector_const_iterator&lt;std::_Vector_val&lt;std::_Simple_types&lt;Dice&gt;&gt;&gt;' ConsoleApplication3 c:\users\miguel\documents\visual studio 2015\projects\consoleapplication3\consoleapplication3\consoleapplication3.cpp   60</code></p>

<p>Any idea why this is happening?</p>