   Is this a good Idea.
  I have this SquareMatrix class, and I would like to allow something like this :SquareMatrix::Type A[4] = {1,2,3,4};SquareMatrix mat(A,A+4); //create a 2 x 2 array(mat * (1,2) ).print(); // allow this [1](mat * (1,2,3,4)).print(); //allow this [2][1] is treated as (2x2) matrix times (2x1) vector[2] is treated as (2x2) matrix times (2x2) matrixwould those be a good idea to implement. I was thinking about it, but then when Iwrote this post, it seems to be confusing.   
  It's confusing. 4 numbers in a row is a simple vector, or ?x1 matrix.   ;  I reckon that with this logic<br>(mat * (1,2,3,4)).print(); //allow this [2]<br></code><br><br>Would make even some sense.<br>However, as "*" is a binary operator, you would have to create a temporary object, which according to my understanding the compiler cant create just from there?<br><br><br><!--STARTSCRIPT--><!--source lang="cpp"--><div class="source"><pre><br>(mat * (<span class="cpp-number">1</span>,<span class="cpp-number">2</span>) ).print(); <span class="cpp-comment">// allow this [1]</span><br><br><br></pre></div><!--ENDSCRIPT--><br><br>This however would depend &#111;n implementation. It has the same issue as above, but according to parameters, it would create a 2x2 matrix, with &#111;nly first row determined. ( Assuming its still the same SquareMatrix class and not some third thing messing about). Surely you could have overloaded constructor, but its kinda hard to guess what are the constraints here.<br><br><br>I reckon the thing would work with<br><br><!--STARTSCRIPT--><!--source lang="cpp"--><div class="source"><pre><br>(mat * SquareMatrix(<span class="cpp-number">1</span>,<span class="cpp-number">2</span>) ).print(); <span class="cpp-comment">// allow this [1]</span><br><br><br></pre></div><!--ENDSCRIPT--><br><br>Assuming that the operator returns a third Matrix and not a void and that the Constructor has default parameter 0 for every parameter.<br><br>Would work, sure.<br>But seems like a hugely inflexible system.;  Well I could have overloaded the following operator :ReturnType operator()(...){ /*logic*/}And by the number of args provided, if its m_row number of args, then its avector, if its m_row*m_row number of args, then is the matrix, anything elseis undefined. I see a problem here, but I decided not to do this since, its kind of confusing, I guess.   