On Wednesday, 16 October 2013 at 17:05:25 UTC, Daniel Davidson wrote:
import std.conv;

struct T {
  int[] i;
  string[string] ss;
}

void foo(ref T t) {
}

void main() {
  T t1;
  auto t2 = immutable T();
  foo(t1);
  foo(cast()t2);
}

It works as it should. Make a mutable copy of t2 and pass it. Or make foo() accept const. I can't imagine a single legitimate use case for destroying type system in a way you want.

Reply via email to