Tuples and array literals

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Tue Mar 6 15:30:02 PST 2007


I tried to search the ng and dstress test cases, but there was nothing
about these.

So here are the working ones:

  const a = [1,2];
  int[] b = [1,2];

  struct foo {
    const int[] c = [1,2];
    const d = [1,2];
  }

  void main() {
    const e = [1,2];
  }

These ones don't work:

  template Tuple(E...) { alias E Tuple; }
  alias Tuple!(0,1) TP;

  const a = [ TP ];
  int[] b = [ TP ];

  struct foo {
    const int[] c = [ TP ];
    const d = [ TP ];
  }

So, are these going to be fixed in future releases or is there some
serious limitation in the template/tuple system that prevents any of
these? Any workarounds that make use of tuples?


More information about the Digitalmars-d-learn mailing list