mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-15 02:43:14 +08:00
remove makeconst_return_type
This commit is contained in:
parent
f0ba513f41
commit
46387cc180
@ -25,6 +25,13 @@
|
|||||||
#ifndef EIGEN_DENSECOEFFSBASE_H
|
#ifndef EIGEN_DENSECOEFFSBASE_H
|
||||||
#define 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.
|
/** \brief Base class providing read-only coefficient access to matrices and arrays.
|
||||||
* \ingroup Core_Module
|
* \ingroup Core_Module
|
||||||
* \tparam Derived Type of the derived class
|
* \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
|
// 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.
|
// 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),
|
typedef typename internal::conditional<bool(internal::traits<Derived>::Flags&LvalueBit),
|
||||||
const Scalar&,
|
const Scalar&,
|
||||||
typename internal::conditional<internal::is_arithmetic<Scalar>::value, Scalar, const Scalar>::type
|
typename internal::conditional<internal::is_arithmetic<Scalar>::value, Scalar, const Scalar>::type
|
||||||
>::type CoeffReturnType;
|
>::type CoeffReturnType;
|
||||||
typedef typename internal::makeconst_return_type<typename internal::packet_traits<Scalar>::type>::type PacketReturnType;
|
|
||||||
|
typedef typename internal::add_const_on_value_type_if_arithmetic<
|
||||||
|
typename internal::packet_traits<Scalar>::type
|
||||||
|
>::type PacketReturnType;
|
||||||
|
|
||||||
typedef EigenBase<Derived> Base;
|
typedef EigenBase<Derived> Base;
|
||||||
using Base::rows;
|
using Base::rows;
|
||||||
|
@ -92,11 +92,6 @@ template<typename T> struct add_const_on_value_type<T*> { typedef T const
|
|||||||
template<typename T> struct add_const_on_value_type<T* const> { typedef T const* const type; };
|
template<typename T> struct add_const_on_value_type<T* const> { typedef T const* const type; };
|
||||||
template<typename T> struct add_const_on_value_type<T const* const> { typedef T const* const type; };
|
template<typename T> struct add_const_on_value_type<T const* const> { typedef T const* const type; };
|
||||||
|
|
||||||
template<typename T> struct makeconst_return_type
|
|
||||||
{
|
|
||||||
typedef typename conditional<is_arithmetic<T>::value, T, typename add_const_on_value_type<T>::type>::type type;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** \internal Allows to enable/disable an overload
|
/** \internal Allows to enable/disable an overload
|
||||||
* according to a compile time condition.
|
* according to a compile time condition.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user