Index: boost/numeric/ublas/functional.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/numeric/ublas/functional.hpp,v retrieving revision 1.34 diff -u -p -r1.34 functional.hpp --- boost/numeric/ublas/functional.hpp 2 Oct 2005 12:16:38 -0000 1.34 +++ boost/numeric/ublas/functional.hpp 4 Nov 2005 11:32:46 -0000 @@ -36,6 +36,8 @@ namespace boost { namespace numeric { na #include #endif +#include + namespace boost { namespace numeric { namespace ublas { @@ -1390,6 +1392,7 @@ namespace boost { namespace numeric { na size_type element (size_type i, size_type size1, size_type j, size_type size2) { BOOST_UBLAS_CHECK (i < size1, bad_index ()); BOOST_UBLAS_CHECK (j < size2, bad_index ()); + detail::ignore_unused_variable_warning(size1); // Guard against size_type overflow BOOST_UBLAS_CHECK (i <= ((std::numeric_limits::max) () - j) / size2, bad_index ()); return i * size2 + j; @@ -1401,6 +1404,7 @@ namespace boost { namespace numeric { na BOOST_UBLAS_CHECK (j <= size2, bad_index ()); // Guard against size_type overflow - address may be size2 past end of storage BOOST_UBLAS_CHECK (size2 == 0 || i <= ((std::numeric_limits::max) () - j) / size2, bad_index ()); + detail::ignore_unused_variable_warning(size1); return i * size2 + j; } static @@ -1458,6 +1462,8 @@ namespace boost { namespace numeric { na BOOST_UBLAS_CHECK (i < size1, bad_index ()); BOOST_UBLAS_CHECK (j < size2, bad_index ()); BOOST_UBLAS_CHECK (i >= j, bad_index ()); + detail::ignore_unused_variable_warning(size1); + detail::ignore_unused_variable_warning(size2); // FIXME size_type overflow // sigma_i (i + 1) = (i + 1) * i / 2 // i = 0 1 2 3, sigma = 0 1 3 6 @@ -1479,24 +1485,28 @@ namespace boost { namespace numeric { na BOOST_UBLAS_INLINE size_type element1 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) { BOOST_UBLAS_CHECK (i < size1, bad_index ()); + detail::ignore_unused_variable_warning(size1); return i; } static BOOST_UBLAS_INLINE size_type element2 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) { BOOST_UBLAS_CHECK (j < size2, bad_index ()); + detail::ignore_unused_variable_warning(size2); return j; } static BOOST_UBLAS_INLINE size_type address1 (size_type i, size_type size1, size_type /* j */, size_type /* size2 */) { BOOST_UBLAS_CHECK (i <= size1, bad_index ()); + detail::ignore_unused_variable_warning(size1); return i; } static BOOST_UBLAS_INLINE size_type address2 (size_type /* i */, size_type /* size1 */, size_type j, size_type size2) { BOOST_UBLAS_CHECK (j <= size2, bad_index ()); + detail::ignore_unused_variable_warning(size2); return j; } static Index: boost/numeric/ublas/vector.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/numeric/ublas/vector.hpp,v retrieving revision 1.68 diff -u -p -r1.68 vector.hpp --- boost/numeric/ublas/vector.hpp 16 Oct 2005 16:05:52 -0000 1.68 +++ boost/numeric/ublas/vector.hpp 4 Nov 2005 11:32:47 -0000 @@ -20,6 +20,7 @@ #include #include #include +#include // Iterators based on ideas of Jeremy Siek @@ -74,10 +75,10 @@ namespace boost { namespace numeric { na vector_assign (*this, ae); } - // Random Access Container + // Random Access Container BOOST_UBLAS_INLINE size_type max_size () const { - return data_.max_size (); + return data_.max_size (); } BOOST_UBLAS_INLINE @@ -337,7 +338,7 @@ namespace boost { namespace numeric { na } BOOST_UBLAS_INLINE const_reference operator [] (difference_type n) const { - return *(it_ + n); + return *(it_ + n); } // Index @@ -438,7 +439,7 @@ namespace boost { namespace numeric { na } BOOST_UBLAS_INLINE reference operator [] (difference_type n) const { - return *(it_ + n); + return *(it_ + n); } // Index @@ -720,6 +721,7 @@ namespace boost { namespace numeric { na BOOST_UBLAS_INLINE bool operator == (const const_iterator &it) const { BOOST_UBLAS_CHECK (&(*this) () == &it (), external_logic ()); + detail::ignore_unused_variable_warning(it); return true; } }; @@ -1132,7 +1134,7 @@ namespace boost { namespace numeric { na } BOOST_UBLAS_INLINE const_reference operator [] (difference_type n) const { - return *(*this + n); + return *(*this + n); } // Index @@ -1502,7 +1504,7 @@ namespace boost { namespace numeric { na } BOOST_UBLAS_INLINE const_reference operator [] (difference_type n) const { - return *(it_ + n); + return *(it_ + n); } // Index @@ -1603,7 +1605,7 @@ namespace boost { namespace numeric { na } BOOST_UBLAS_INLINE reference operator [] (difference_type n) const { - return *(it_ + n); + return *(it_ + n); } // Index Index: boost/numeric/ublas/detail/definitions.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/numeric/ublas/detail/definitions.hpp,v retrieving revision 1.5 diff -u -p -r1.5 definitions.hpp --- boost/numeric/ublas/detail/definitions.hpp 1 Jul 2005 20:09:01 -0000 1.5 +++ boost/numeric/ublas/detail/definitions.hpp 4 Nov 2005 11:32:47 -0000 @@ -20,6 +20,15 @@ namespace boost { namespace numeric { namespace ublas { + namespace detail { + /* Borrowed from boost/concept_checks.hpp + "inline" is used for ignore_unused_variable_warning() + to make sure there is no overhead with g++. + */ + template inline + void ignore_unused_variable_warning(const T&) {} + } // namespace detail + // Borrowed from Dave Abraham's noncopyable. // I believe this should be part of utility.hpp one day... namespace nonassignable_ // protection from unintended ADL