From 1fbfe3263d408a2d282e7c3527527609c691ff44 Mon Sep 17 00:00:00 2001 From: Michael Stevens Date: Sun, 29 Aug 2004 09:08:20 +0000 Subject: [PATCH] workaround gcc.2.95 bug with ? operator and const return value svn path=/trunk/boost/boost/numeric/ublas/; revision=24803 --- include/boost/numeric/ublas/matrix.hpp | 5 ++++- include/boost/numeric/ublas/vector.hpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 7c23de7f..10bbe5c3 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -2024,7 +2024,10 @@ namespace boost { namespace numeric { namespace ublas { // Element access BOOST_UBLAS_INLINE const_reference operator () (size_type i, size_type j) const { - return i == j ? one_ : zero_; + if (i == j) + return one_; + else + return zero_; } // Assignment diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 4a31acd7..f48857de 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -667,7 +667,10 @@ namespace boost { namespace numeric { namespace ublas { // Element access BOOST_UBLAS_INLINE const_reference operator () (size_type i) const { - return i == index_ ? one_ : zero_; + if (i == index_) + return one_; + else + return zero_; } BOOST_UBLAS_INLINE