Boost logo

Ublas :

From: Ott Toomet (otoomet_at_[hidden])
Date: 2005-09-14 14:19:13


Thanks, Michael,

this little hack works. BTW, 1.33.0 has the same problem, just on
different line numbers.

Best,
Ott

 | From: Michael Stevens <mail_at_[hidden]>
 | Date: Wed, 14 Sep 2005 11:23:24 +0200
 | > unfortunately shallow_array_adaptor does not work for me. If I
 | > declare
 | >
 | > #define BOOST_UBLAS_SHALLOW_ARRAY_ADAPTOR
 | >
 | > it results compiler errors:
 | >
 | > g++ -c aakatse.c++ -O2 -Wall -Wno-unknown-pragmas -I/usr/include
 | > In file included from /usr/include/boost/numeric/ublas/vector.hpp:23,
 | > from aakatse.c++:4:
 | > /usr/include/boost/numeric/ublas/storage.hpp:707: error: declaration of
 | > `class T' /usr/include/boost/numeric/ublas/storage.hpp:703: error: shadows
 | > template parm `class T'
 | >
 | > even without any additonal code.
 | >
 | > Is it a problem with boost 1.32/gcc 3.4 or do I have to do someting in
 | > a different way?
 |
 | It something that only recent(ish) 'gcc' complain about. This was the fix I
 | just applied to 1.33. The change is fairly simple. The delaration round line
 | 707 need to change to
 | template<class TT>
 | struct leaker {
 | typedef void result_type;
 | typedef TT *argument_type;
 |
 | BOOST_UBLAS_INLINE
 | result_type operator () (argument_type x) {}
 | };
 |
 | That is, the template parameter is renamed TT from T.
...
 | Michael