http://d.puremagic.com/issues/show_bug.cgi?id=5984
--- Comment #2 from Christopher the Magnificent <ultimatemacfana...@gmail.com> 2011-05-13 10:09:30 PDT --- Where do I find the "const(Object) ref" syntax described? I've never run across it in the D Language Reference. Point me to some info about this particular syntax and then I'll be able to comment on how my own syntax may be superior. (In reply to comment #1) > How is this better than the 'const(Object) ref' syntax*? > > class A { ... } > > immutable(A) func(immutable A a1, immutable A a2) { > immutable(A) ref a_ptr = null; > ... > } > > and > > const(ClassName)ref[] myArray; > > Actually there is already std.typecons.Rebindable which mostly works (uglily): > > class A { ... } > > immutable(A) func(immutable A a1, immutable A a2) { > Rebindable!(immutable(A)) a_ptr = null; > ... > } > > and > > Rebindable!(const(ClassName))[] myArray; > myArray.length = 1; > myArray[0] = constant_object; > myArray ~= rebindable(constant_object); > > *: https://github.com/D-Programming-Language/dmd/pull/3 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------