diff options
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 1f30fba1c..bc472d720 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 <typename U, typename... Args> + void construct( U* u, Args&&... args) + { + ::new( static_cast<void*>(u) ) U( std::forward<Args>( args )... ); + } +#endif + void destroy( pointer p ) { p->~T(); } +#if (__cplusplus >= 201103L) + template <typename U> + void destroy( U* u ) + { + u->~U(); + } +#endif + void deallocate( pointer p, size_type /*num*/ ) { internal::aligned_free( p ); |