Advertisement
Guest User

Mono-D completion test

a guest
Feb 4th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.36 KB | None | 0 0
  1. module Main;
  2.  
  3. struct TestField(T)
  4. {
  5.     T t;
  6.     alias t this; // doesn't matter
  7. }
  8.  
  9. mixin template MyTemplate(alias T)
  10. {
  11.     auto Field1 = T!(ulong)();
  12.     auto Field2 = T!(string)();
  13. }
  14.  
  15. class TestClass
  16. {
  17.     mixin MyTemplate!(TestField);
  18. }
  19.  
  20. void main(string[] args)
  21. {
  22.     TestClass c = new TestClass();
  23.     c.Field1 = 5; // complete there
  24.     c.Field2 = "test";
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement