Guest User

Untitled

a guest
Jul 22nd, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.32 KB | None | 0 0
  1. auto str = "
  2. class MyClass
  3. {
  4.    this(int a, float b)
  5.    {
  6.    }
  7. }";
  8.  
  9. // One way
  10. ldc.Class cls = executionEngine.getClassByName("MyClass");
  11.  
  12. auto ctor = cls.getConstructor!(function(int, float))();
  13. Object instance = ctor(1, 3.14);
  14.  
  15. // Another way
  16. Object instance = cls.instantiate([Variant(1), Variant(3.14)]);
Add Comment
Please, Sign In to add comment