Advertisement
Pillager86

Untitled

May 2nd, 2020
1,233
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // doesn't compile
  2. import std.stdio;
  3. import gfm.math.matrix;
  4.  
  5. void test(T...)(T[] types)
  6. {
  7.     best(types);
  8. }
  9.  
  10. void best(T...)(T[] types)
  11. {
  12.     foreach(t ; types)
  13.     {
  14.         writefln("%s: %s", typeof(t).stringof, t.sizeof);
  15.     }
  16. }
  17.  
  18. void main()
  19. {
  20.     float foo;
  21.     mat4x4f bar;
  22.     float[3] baz;
  23.     bar.c[0][0] = 25.0f;
  24.     test!(typeof(foo), typeof(bar), typeof(baz))(foo, bar, baz);
  25. }
Advertisement
RAW Paste Data Copied
Advertisement