Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Main;
- struct TestField(T)
- {
- T t;
- alias t this; // doesn't matter
- }
- mixin template MyTemplate(alias T)
- {
- auto Field1 = T!(ulong)();
- auto Field2 = T!(string)();
- }
- class TestClass
- {
- mixin MyTemplate!(TestField);
- }
- void main(string[] args)
- {
- TestClass c = new TestClass();
- c.Field1 = 5; // complete there
- c.Field2 = "test";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement