diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index 4bd1046a7..8dc015715 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -93,7 +93,7 @@ public: ? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) ) : int(NoUnrolling) }; - + static void debug() { EIGEN_DEBUG_VAR(DstIsAligned) diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index ef4485f5b..259f40244 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -350,7 +350,7 @@ struct ei_scalar_multiple_op { EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a * m_other; } EIGEN_STRONG_INLINE const PacketScalar packetOp(const PacketScalar& a) const { return ei_pmul(a, ei_pset1(m_other)); } - const typename NumTraits::Nested m_other; + typename ei_makeconst::Nested>::type m_other; private: ei_scalar_multiple_op& operator=(const ei_scalar_multiple_op&); }; @@ -364,7 +364,7 @@ struct ei_scalar_multiple2_op { EIGEN_STRONG_INLINE ei_scalar_multiple2_op(const ei_scalar_multiple2_op& other) : m_other(other.m_other) { } EIGEN_STRONG_INLINE ei_scalar_multiple2_op(const Scalar2& other) : m_other(other) { } EIGEN_STRONG_INLINE result_type operator() (const Scalar1& a) const { return a * m_other; } - const typename NumTraits::Nested m_other; + typename ei_makeconst::Nested>::type m_other; }; template struct ei_functor_traits > @@ -393,7 +393,7 @@ struct ei_scalar_quotient1_impl { EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const ei_scalar_quotient1_impl& other) : m_other(other.m_other) { } EIGEN_STRONG_INLINE ei_scalar_quotient1_impl(const Scalar& other) : m_other(other) {} EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; } - const typename NumTraits::Nested m_other; + typename ei_makeconst::Nested>::type m_other; }; template struct ei_functor_traits > diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index f8581eebc..bc5235582 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -83,7 +83,7 @@ inline void* ei_aligned_malloc(size_t size) ei_assert(false && "heap allocation is forbidden (EIGEN_NO_MALLOC is defined)"); #endif - void *result; + void *result; #if !EIGEN_ALIGN result = malloc(size); #elif EIGEN_MALLOC_ALREADY_ALIGNED @@ -97,7 +97,7 @@ inline void* ei_aligned_malloc(size_t size) #else result = ei_handmade_aligned_malloc(size); #endif - + #ifdef EIGEN_EXCEPTIONS if(result == 0) throw std::bad_alloc(); @@ -324,34 +324,34 @@ public: typedef aligned_allocator other; }; - pointer address( reference value ) const + pointer address( reference value ) const { return &value; } - const_pointer address( const_reference value ) const + const_pointer address( const_reference value ) const { return &value; } - aligned_allocator() throw() + aligned_allocator() throw() { } - aligned_allocator( const aligned_allocator& ) throw() + aligned_allocator( const aligned_allocator& ) throw() { } template - aligned_allocator( const aligned_allocator& ) throw() + aligned_allocator( const aligned_allocator& ) throw() { } - ~aligned_allocator() throw() + ~aligned_allocator() throw() { } - size_type max_size() const throw() + size_type max_size() const throw() { return std::numeric_limits::max(); } @@ -362,24 +362,24 @@ public: return static_cast( ei_aligned_malloc( num * sizeof(T) ) ); } - void construct( pointer p, const T& value ) + void construct( pointer p, const T& value ) { ::new( p ) T( value ); } - void destroy( pointer p ) + void destroy( pointer p ) { p->~T(); } - void deallocate( pointer p, size_type /*num*/ ) + void deallocate( pointer p, size_type /*num*/ ) { ei_aligned_free( p ); } - + bool operator!=(const aligned_allocator& other) const { return false; } - + bool operator==(const aligned_allocator& other) const { return true; } }; diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 3a960bea6..2fdfd93b5 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -64,6 +64,13 @@ template struct ei_cleantype { typedef typename ei_cleant template struct ei_cleantype { typedef typename ei_cleantype::type type; }; template struct ei_cleantype { typedef typename ei_cleantype::type type; }; +template struct ei_makeconst { typedef const T type; }; +template struct ei_makeconst { typedef const T type; }; +template struct ei_makeconst { typedef const T& type; }; +template struct ei_makeconst { typedef const T& type; }; +template struct ei_makeconst { typedef const T* type; }; +template struct ei_makeconst { typedef const T* type; }; + /** \internal Allows to enable/disable an overload * according to a compile time condition. */