preparing for const, final, and invariant

Manfred Nowak svv1999 at hotmail.com
Thu May 17 19:08:40 PDT 2007


Walter Bright wrote

> Frank Benoit wrote:
>> int[] g;
>> void foo(in int[] a){
>>     g = a.dup;    // allowed?
>> }
> 
> Yes.

The `.dup'ing an array where a cell contains a reference to the array 
is allowed too?

alias void* T;
T[] a;
void main(){
  T[] g; g.length= 1;
  g[0]=&g;
  void f( in T[] p){
    a= p.dup;
  }
}

That would contradict the given rule.

-manfred



More information about the Digitalmars-d-announce mailing list