From e05db0cd2d402ab40f90a524db19b5aedd085181 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Fri, 23 Sep 2005 09:24:59 +0000 Subject: [PATCH] FIX poor performance due to expression eval in BOOST_UBLAS_CHECK This will create some unused variable warnings [SVN r31087] --- include/boost/numeric/ublas/exception.hpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/include/boost/numeric/ublas/exception.hpp b/include/boost/numeric/ublas/exception.hpp index 2f6007c2..c37049de 100644 --- a/include/boost/numeric/ublas/exception.hpp +++ b/include/boost/numeric/ublas/exception.hpp @@ -208,7 +208,7 @@ namespace boost { namespace numeric { namespace ublas { }; #if BOOST_UBLAS_CHECK_ENABLE -// FIXME for performance reasons we better use macros +// Macros are equivilent to // template // BOOST_UBLAS_INLINE // void check (bool expression, const E &e) { @@ -221,8 +221,6 @@ namespace boost { namespace numeric { namespace ublas { // if (! expression) // e.raise (); // } -// Dan Muller reported problems with COMO in GUI applications -// So we need a new preprocessor symbol: #ifndef BOOST_UBLAS_NO_STD_CERR #define BOOST_UBLAS_CHECK(expression, e) \ if (! (expression)) { \ @@ -247,22 +245,20 @@ namespace boost { namespace numeric { namespace ublas { } #endif #else -// FIXME for performance reasons we better use macros +// Macros are equivilent to // template // BOOST_UBLAS_INLINE // void check (bool expression, const E &e) {} // template // BOOST_UBLAS_INLINE // void check_ex (bool expression, const char *file, int line, const E &e) {} -#define BOOST_UBLAS_CHECK(expression, e) \ - if (! (expression) ); -#define BOOST_UBLAS_CHECK_EX(expression, file, line, e) \ - if (! (expression) ); +#define BOOST_UBLAS_CHECK(expression, e) +#define BOOST_UBLAS_CHECK_EX(expression, file, line, e) #endif #ifndef BOOST_UBLAS_USE_FAST_SAME -// FIXME for performance reasons we better use macros +// Macro is equivilent to // template // BOOST_UBLAS_INLINE // const T &same_impl (const T &size1, const T &size2) { @@ -281,7 +277,7 @@ namespace boost { namespace numeric { namespace ublas { } #define BOOST_UBLAS_SAME(size1, size2) same_impl_ex ((size1), (size2), __FILE__, __LINE__) #else -// FIXME for performance reasons we better use macros +// Macros are equivilent to // template // BOOST_UBLAS_INLINE // const T &same_impl (const T &size1, const T &size2) {