aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/util/Memory.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-02-14 15:31:39 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-02-14 15:31:39 +0100
commit0508af42870e01922f8195c70f1bf920e1df2b0a (patch)
treec4951611e00b8e87f29c2b729a8a206163b00c28 /Eigen/src/Core/util/Memory.h
parent3283d98d1378ccd3a8c89eec1d88108ddd517d95 (diff)
parent4c08385b740c89be225546ddb0403f6e3d0be3e2 (diff)
Merged in martinhofernandes/eigen (pull request PR-40)
Better fix for bug #503
Diffstat (limited to 'Eigen/src/Core/util/Memory.h')
-rw-r--r--Eigen/src/Core/util/Memory.h16
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 );