Advertisement
Pillager86

Untitled

May 2nd, 2020
1,204
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import std.stdio;
  2. import gfm.math.matrix;
  3.  
  4. class Foo
  5. {
  6.     Foo bar(T, int num, bool norm)(string name)
  7.     {
  8.         writeln(counter++);
  9.         writefln("%s %ss, %s for %s", num, T.stringof, norm, name);
  10.         return this;
  11.     }
  12.  
  13.     uint counter;
  14. }
  15.  
  16. void main()
  17. {
  18.     auto foo = new Foo;
  19.     foo.bar!(float, 3, false)("first").bar!(float, 2, true)("second");
  20. }
Advertisement
RAW Paste Data Copied
Advertisement