Mostly implemented Simultaneous Declaration, only template instantation during pass 2 remains to be implemented

This commit is contained in:
Nathan Braswell
2014-05-24 14:04:32 -04:00
parent 0f6b6c0c67
commit ae9e652f1e
10 changed files with 461 additions and 30 deletions

View File

@@ -0,0 +1,30 @@
import io;
typedef template <T> TemplateTest {
int a;
T b;
void print() {
print("a: ");
print(a);
print("\n");
print("b: ");
print(b);
print("\n");
}
};
int main() {
TemplateTest<int> test;
TemplateTest<char*> test2;
test.a = 5;
test.b = 7;
test2.a = 9;
test2.b = "Hello Templates!";
test.print();
test2.print();
return 0;
}