From 3a4616d6e3d7d60af5ba569b0d36e954d45a6fb9 Mon Sep 17 00:00:00 2001 From: Martinho Fernandes Date: Fri, 10 Jan 2014 11:02:11 +0100 Subject: Add C++11 allocator overloads to avoid implicit conversions. --- Eigen/src/Core/util/Memory.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index d177e8b5a..c1050e1ea 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -761,11 +761,27 @@ public: ::new( p ) T( value ); } +#if (__cplusplus >= 201103L) + template + void construct( U* u, Args&&... args) + { + ::new( u ) U( std::forward( args )... ); + } +#endif + void destroy( pointer p ) { p->~T(); } +#if (__cplusplus >= 201103L) + template + void destroy( U* u ) + { + u->~U(); + } +#endif + void deallocate( pointer p, size_type /*num*/ ) { internal::aligned_free( p ); -- cgit v1.2.3