Created
April 10, 2015 22:07
-
-
Save adamnemecek/837752ff8f3bccc2fc96 to your computer and use it in GitHub Desktop.
create.template.mm
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
#import <Foundation/Foundation.h> | |
template<typename T> | |
T *Create() | |
{ | |
return [[T alloc] init]; | |
} | |
#define CREATE(T) Create<T>() | |
void f() | |
{ | |
NSMutableArray *t = CREATE(NSMutableArray); | |
NSMutableArray *a = @[@1, @2]; | |
//[t addObjects:]; | |
} | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
f(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment