Created
May 4, 2015 17:01
-
-
Save asarium/345f8f1b84d2e5b93a2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/code/globalincs/vmallocator.h b/code/globalincs/vmallocator.h | |
index 0079d04..2bd9254 100644 | |
--- a/code/globalincs/vmallocator.h | |
+++ b/code/globalincs/vmallocator.h | |
@@ -54,9 +54,15 @@ public: | |
typedef const value_type& const_reference; | |
/* portej05 does not like this particular function. */ | |
- void construct( pointer p, const T& value ) | |
+ void construct(pointer p, const T& arg) | |
{ | |
- ::new (p) T(value); | |
+ ::new ((void*)p) T(arg); | |
+ } | |
+ | |
+ template<typename U, typename... Args> | |
+ void construct(U* p, Args&&... args) | |
+ { | |
+ ::new ((void*)p) U(std::forward<Args>(args)...); | |
} | |
void destroy( pointer p ) | |
@@ -64,6 +70,12 @@ public: | |
DESTROY( T, p ); | |
} | |
+ template<typename U> | |
+ void destroy( U* p ) | |
+ { | |
+ DESTROY( U, p ); | |
+ } | |
+ | |
pointer allocate( size_type n ) | |
{ | |
if ( n == 0 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment