Can I call constructor within an arithmetic expression?
<p>I am implementing a Matrix class and I overloaded the <code>*</code> and <code>+</code> operators. I also have a constructor:</p>

<pre><code>Matrix (int row, int col, const elemType &amp;init_val) 
</code></pre>

<p>that constructs a matrix initialized to hold init_val in all positions. So based on this implementation, I have in my test program:</p>

<pre><code> Matrix&lt;int&gt; mi4 = Matrix&lt;int&gt; (2, 2, 3) + Matrix&lt;int&gt; (2, 2, 1);
</code></pre>

<p>The compiler gives me the following error:</p>

<pre><code>testMatrix.cpp:41: error: ambiguous overload for ‘operator+’ in ‘Matrix&lt;int&gt;(2, 2, ((const int&amp;)((const int*)(&amp;3)))) + Matrix&lt;int&gt;(2, 2, ((const int&amp;)((const int*)(&amp;1))))’
Matrix.h:91: note: candidates are: Matrix&lt;elemType&gt; operator+(const Matrix&lt;elemType&gt;&amp;, const Matrix&lt;elemType&gt;&amp;) [with elemType = int]
</code></pre>

<p>I remember in C++ standard library, you can call constructor within an expression. How can I implement that? Thanks a lot!</p>
