fork download
  1. import std.string;
  2. import std.stdio;
  3.  
  4.  
  5. struct S {
  6. ubyte[] metadata;
  7.  
  8. string toString(){
  9. return "%s".format( metadata );
  10. }
  11. }
  12.  
  13. struct Foo {
  14. S[] bar;
  15. alias bar this;
  16.  
  17. string toString(){
  18. return "%s".format( bar );
  19. }
  20. }
  21.  
  22. void main(){
  23. S s;
  24. s.metadata = [0,1,2];
  25. Foo foo;
  26. foo.bar = [s];
  27.  
  28. writeln( foo );
  29.  
  30. }
  31.  
  32.  
Success #stdin #stdout 0.02s 2140KB
stdin
Standard input is empty
stdout
[[0,1,2]]