[M3devel] Enumeration or subrange value out of range
Hendrik Boom
hendrik at topoi.pooq.com
Tue Nov 30 15:45:01 CET 2010
On Tue, Nov 30, 2010 at 08:32:12AM +0000, Jay K wrote:
>
>
> Consider this though, have you heard the ability to do this:
> matrix<int> a,b,c,d;
> a = b + c + d;
Does it work as well for a = b + a + d?
>
>
> where there are no intermediate matrices?
> The results are written directly into a.
>
>
> The people do this is that operator+ doesn't return a matrix, but rather
> a type that represents the result matrix addition, which is assignable
> to a matrix, and can also be added to matrices or the results of matrix addition.
> So ultimately what is assigned to a is something representation the addition
> of b, c, d. You can add any number of matrices. Or subtract. Or multiply (within
> the rules of matrix multiplication) etc. There is no special casing, no special
> purpose code to handle certain combinations. I don't believe any other
> language has this power.
Or a = a * a * a?
-- hendrik
More information about the M3devel
mailing list