mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
fix very annoying warning (gcc 4.3): type qualifiers ignored on function return type
This commit is contained in:
parent
01553c419e
commit
75b6d2b2f8
@ -33,8 +33,11 @@ class DenseCoeffsBase : public EigenBase<Derived>
|
||||
typedef typename ei_traits<Derived>::Index Index;
|
||||
typedef typename ei_traits<Derived>::Scalar Scalar;
|
||||
typedef typename ei_packet_traits<Scalar>::type PacketScalar;
|
||||
typedef typename ei_meta_if<ei_has_direct_access<Derived>::ret, const Scalar&, const Scalar>::ret CoeffReturnType;
|
||||
typedef typename ei_makeconst<typename ei_packet_traits<Scalar>::type>::type PacketReturnType;
|
||||
typedef typename ei_meta_if<ei_has_direct_access<Derived>::ret,
|
||||
const Scalar&,
|
||||
typename ei_meta_if<ei_is_arithmetic<Scalar>::ret, Scalar, const Scalar>::ret
|
||||
>::ret CoeffReturnType;
|
||||
typedef typename ei_makeconst_return_type<typename ei_packet_traits<Scalar>::type>::type PacketReturnType;
|
||||
|
||||
typedef EigenBase<Derived> Base;
|
||||
using Base::rows;
|
||||
|
@ -33,6 +33,10 @@ typedef __m128 Packet4f;
|
||||
typedef __m128i Packet4i;
|
||||
typedef __m128d Packet2d;
|
||||
|
||||
template<> struct ei_is_arithmetic<__m128> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<__m128i> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<__m128d> { enum { ret = true }; };
|
||||
|
||||
#define ei_vec4f_swizzle1(v,p,q,r,s) \
|
||||
(_mm_castsi128_ps(_mm_shuffle_epi32( _mm_castps_si128(v), ((s)<<6|(r)<<4|(q)<<2|(p)))))
|
||||
|
||||
|
@ -64,6 +64,21 @@ template<typename T> struct ei_cleantype<T&> { typedef typename ei_cleant
|
||||
template<typename T> struct ei_cleantype<const T*> { typedef typename ei_cleantype<T>::type type; };
|
||||
template<typename T> struct ei_cleantype<T*> { typedef typename ei_cleantype<T>::type type; };
|
||||
|
||||
template<typename T> struct ei_is_arithmetic { enum { ret = false }; };
|
||||
template<> struct ei_is_arithmetic<float> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<double> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<long double> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<bool> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<char> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<signed char> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<unsigned char> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<signed short> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<unsigned short>{ enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<signed int> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<unsigned int> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<signed long> { enum { ret = true }; };
|
||||
template<> struct ei_is_arithmetic<unsigned long> { enum { ret = true }; };
|
||||
|
||||
template<typename T> struct ei_makeconst { typedef const T type; };
|
||||
template<typename T> struct ei_makeconst<const T> { typedef const T type; };
|
||||
template<typename T> struct ei_makeconst<T&> { typedef const T& type; };
|
||||
@ -71,6 +86,11 @@ template<typename T> struct ei_makeconst<const T&> { typedef const T& type; };
|
||||
template<typename T> struct ei_makeconst<T*> { typedef const T* type; };
|
||||
template<typename T> struct ei_makeconst<const T*> { typedef const T* type; };
|
||||
|
||||
template<typename T> struct ei_makeconst_return_type
|
||||
{
|
||||
typedef typename ei_meta_if<ei_is_arithmetic<T>::ret, T, typename ei_makeconst<T>::type>::ret type;
|
||||
};
|
||||
|
||||
/** \internal Allows to enable/disable an overload
|
||||
* according to a compile time condition.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user