dmd 2.060 ignoring ref for Array arguments

d coder dlang.coder at gmail.com
Mon Jul 2 01:56:33 PDT 2012


Greetings

Normally I use released beta versions of dmd, but this time I started using
dmd 2.060 for sake of std.string.xformat.

But I am facing issues. This version is ignoring "ref" when passing array
as ref argument. Kindly see the code below. When I run this code it prints
"Postblit called!" four time.

Regards
- Puneet

//
struct Foo {
  this(this) {
    import std.stdio;
    writeln("Postblit called!");
  }
}

void barArray(ref Foo[4] _f) { /*do nothing*/ }

void main() {
  Foo [4] fooArray;
  barArray(fooArray);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120702/a239d02d/attachment.html>


More information about the Digitalmars-d mailing list