> when I didn't the compiler couldn't pass the variable without it being static.
If you were having errors then show the messages.
Before you had an `ifstream' member that may the class non-copyable
> Also when you return it by reference,
> which is necessary if this library could ever scale up to bigger operations
you are confused.
Yes, it is true that you should avoid copying big data, however you were not avoiding it.
myMatrix3 = myMatrix1.multiply(myMatrix2);
there you are copying. It doesn't matter that you are "returning a reference", each object have their own copy of the data.
It is better to return by value
http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ (sadly it is not currently working)
C++11 Style (move semantics)
http://www.youtube.com/watch?v=0iWb_qi2-uI (about min 37)
> you would have to either make the variable static
¿do you know what does that mean? The variable would be constructed just
one time, in all the other invocations of that function it would use the
same variable.
So if you do
A+B your `tmpMatrix' would have the size of A. ¿what if later you try
C+D, where the size of C is different?
> Also valarray couldn't be used as a result of it being static in size
that's a shame, although you can "resize" a valarray
however ¿why do you need such requirement? A matrix of different size is another matrix