aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/DenseCoeffsBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-12-01 09:22:50 -0500
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-12-01 09:22:50 -0500
commit46387cc1801701dac3d611e12712429bbae64e88 (patch)
tree2abd57785e375c179aa1f830830eaac3d019ee9e /Eigen/src/Core/DenseCoeffsBase.h
parentf0ba513f418011fb62aa2a8f3dd4c5e51af58743 (diff)
remove makeconst_return_type
Diffstat (limited to 'Eigen/src/Core/DenseCoeffsBase.h')
-rw-r--r--Eigen/src/Core/DenseCoeffsBase.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/Eigen/src/Core/DenseCoeffsBase.h b/Eigen/src/Core/DenseCoeffsBase.h
index 62490fb35..13c93c392 100644
--- a/Eigen/src/Core/DenseCoeffsBase.h
+++ b/Eigen/src/Core/DenseCoeffsBase.h
@@ -25,6 +25,13 @@
#ifndef EIGEN_DENSECOEFFSBASE_H
#define EIGEN_DENSECOEFFSBASE_H
+namespace internal {
+template<typename T> struct add_const_on_value_type_if_arithmetic
+{
+ typedef typename conditional<is_arithmetic<T>::value, T, typename add_const_on_value_type<T>::type>::type type;
+};
+}
+
/** \brief Base class providing read-only coefficient access to matrices and arrays.
* \ingroup Core_Module
* \tparam Derived Type of the derived class
@@ -53,10 +60,13 @@ class DenseCoeffsBase<Derived,ReadOnlyAccessors> : public EigenBase<Derived>
// while the declaration of "const T", where T is a non arithmetic type does not. Always returning "const Scalar&" is
// not possible, since the underlying expressions might not offer a valid address the reference could be referring to.
typedef typename internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit),
- const Scalar&,
- typename internal::conditional<internal::is_arithmetic<Scalar>::value, Scalar, const Scalar>::type
- >::type CoeffReturnType;
- typedef typename internal::makeconst_return_type<typename internal::packet_traits<Scalar>::type>::type PacketReturnType;
+ const Scalar&,
+ typename internal::conditional<internal::is_arithmetic<Scalar>::value, Scalar, const Scalar>::type
+ >::type CoeffReturnType;
+
+ typedef typename internal::add_const_on_value_type_if_arithmetic<
+ typename internal::packet_traits<Scalar>::type
+ >::type PacketReturnType;
typedef EigenBase<Derived> Base;
using Base::rows;