www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd 2.060 ignoring ref for Array arguments


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.

- Puneet

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

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

void main() {
  Foo [4] fooArray;
Jul 02 2012