Re: [eigen] Bug in traspose

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


--- Benoît Jacob <jacob@xxxxxxxxxxxxxxx> wrote:

> OK, first off I think you're right on this: we need to replace .newline() by 
> operator, because of the relative priority of these operators!
> 
> http://www.cplusplus.com/doc/tutorial/operators.html
> 
> operator, has the lowest priority. Whatever set of operators we choose must 
> have equal priorities and left-to-right associativity. The one exception is 
> the first operator which may have higher priority.
> 
> There is a problem with this:
> 
> > Matrix2d m;
> > m <<= (1, 2),
> >       (3, 4);
> 
> Here the first operator, refers to the object 1 and the compiler will treat it 
> as an "int". Since we can't overload operator, on a POD type, I see no way to 
> make this work. Same problem with every solution you're proposing with a 
> parenthesis ( before the 1.

I was thinking more about using va_args inside the operator()(...).
Then , can be overloaded to go to the next row.

I wonder how tvmet gets
m = 1, 2,
    3, 4; 

to work if the , operator is only overloaded in the Matrix<> class...

Cheers
Ben





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/