friend template

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi.
I have the following error case on gcc 3.4.6. It seems like legal c++.
How can it be overcomed ?

Thank you,
Dima.

-------------------------------------------- code
------------------------------------------------
namespace boost { namespace numeric { namespace ublas {

 template<class M> class matrix_row;
 template<typename M> void swap (matrix_row<M> mr1, matrix_row<M> mr2);

   template<class M> class matrix_row : public ... {
     ....
   friend void swap<> (matrix_row mr1, matrix_row mr2); // line 204
    ...
 };

 // definition of swap follows here
...
------------------------------------- error msg
---------------------------------------------
/user_temp/dsorkin/libs/boost_1_33_0/boost/numeric/ublas/matrix_proxy.hpp:204:
error: variable or field `swap' declared void
/user_temp/dsorkin/libs/boost_1_33_0/boost/numeric/ublas/matrix_proxy.hpp:204:
error: `swap' is neither function nor member function; cannot be
declared friend
/user_temp/dsorkin/libs/boost_1_33_0/boost/numeric/ublas/matrix_proxy.hpp:204:
error: expected `;' before '<' token

/user_temp/dsorkin/libs/boost_1_33_0/boost/numeric/ublas/matrix_proxy.hpp:2479:
warning: friend declaration `void
boost::numeric::ublas::swap(boost::numeric::ublas::matrix_range<E>,
boost::numeric::ublas::matrix_range<E>)' declares a non-template
function

----------------------------------- gcc version
-------------------------------------------------
g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux