Boost logo

Boost :

From: Daniel Wesslén (daniel_at_[hidden])
Date: 2006-12-05 05:41:10


Maik Beckmann wrote:
>> #include <math/matrix.tpp>
>> using namespace math;
>>
>> int main() {
>>
>> const indexer<bits::index_swizzle<0,0,2,0> > xxzx;
>> const indexer<bits::index_swizzle<3,2,1,0> > wzyx;
>>
>> vector<4> v1, v2(1,2,3,4);
>>
>> v1 = v2[xxzx]; // v1 = (1,1,3,1)
>> // v1[xxzx] = v2; // error - v1[xxzx] is not a lvalue due to aliasing
>> v1[wzyx] = v2; // v1 = (4,3,2,1)
>>
>> }
>>
>
> I'm sorry if it was mentioned before, but
> g++ 3.4.6/ 4.1.1/ 4.2.0-alpha20061031 don't compile this
>
> <at math2-matrix-vector/src>
> g++-4.1.1 test.cc -I../include
> </at math2-matrix-vector/src>
>
> <error message>
> ../include/math/bits/basic_matrix.h: In member function 'Type
> math::bits::basic_matrix<Rows, Cols, Type>::element() const':
> ../include/math/bits/basic_matrix.h:27: error: there are no arguments to
> 'data' that depend on a template parameter, so a declaration of 'data'
> must be available

[snip more error messages]

Has it been that long since I tested this on gcc?
Changing "data()" on the offending lines to "this->data()" should do it,
though I'm afraid I can't guarantee there won't be other errors like it
at the moment.
Use -fpermissive as suggested if you want to try it out for now.

Thanks.

-- 
Daniel Wesslén

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk