Add C++11 allocator overloads to avoid implicit conversions.

This commit is contained in:
Martinho Fernandes 2014-01-10 11:02:11 +01:00
parent 276801b25a
commit 3a4616d6e3

View File

@ -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 );