mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-23 23:03:15 +08:00
Add C++11 allocator overloads to avoid implicit conversions.
This commit is contained in:
parent
276801b25a
commit
3a4616d6e3
@ -761,11 +761,27 @@ public:
|
|||||||
::new( p ) T( value );
|
::new( p ) T( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (__cplusplus >= 201103L)
|
||||||
|
template <typename U, typename... Args>
|
||||||
|
void construct( U* u, Args&&... args)
|
||||||
|
{
|
||||||
|
::new( u ) U( std::forward<Args>( args )... );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void destroy( pointer p )
|
void destroy( pointer p )
|
||||||
{
|
{
|
||||||
p->~T();
|
p->~T();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (__cplusplus >= 201103L)
|
||||||
|
template <typename U>
|
||||||
|
void destroy( U* u )
|
||||||
|
{
|
||||||
|
u->~U();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void deallocate( pointer p, size_type /*num*/ )
|
void deallocate( pointer p, size_type /*num*/ )
|
||||||
{
|
{
|
||||||
internal::aligned_free( p );
|
internal::aligned_free( p );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user