Boost logo

Ublas :

Subject: [ublas] [bindings] bindings::stride: Avoid "unused variable" warning
From: sguazt (marco.guazzone_at_[hidden])
Date: 2011-02-13 04:09:51


Dear numeric_bindings developers,

In "boost/numeric/bindings/stride.hpp" (line 120), is it possible to
avoid the "unused variable" compiler warnings?
This warning is caused by the "t" parameter, which is not used any more.

Possible solutions:
1. Comment the name of that parameter, that is:
  * current: static std::ptrdiff_t invoke( const T& t ) {
  * patched: static std::ptrdiff_t invoke( const T& /*t*/ ) {

2. Use a "void" statetement, that is:
  * current:
      static std::ptrdiff_t invoke( const T& t ) {
          return 0;
      }
  * patched:
      static std::ptrdiff_t invoke( const T& t ) {
          (void)t;
          return 0;
      }

Thank you very much,

Best,

-- Marco