Phobos
    Georg Wrede 
    georg.wrede at nospam.org
       
    Thu Mar  9 03:52:42 PST 2006
    
    
  
Ben Phillips wrote:
> In article <dune2o$cu4$1 at digitaldaemon.com>, Def says...
> 
>> Array op= operations are not implemented.
> 
> This has been discussed numerous times and the consensus is that
> overloading "=" is a bad idea. You must remember that D uses
> references so if we have a class and two instances ("a" and "b") then
> "a = b;" makes "a" refer to the same object as "b". The programmer
> should not be allowed to change this behavior.
> 
> On the other hand, another operator such as ":=" has been suggested
> which would be a copy operator rather than an assignment operator
It would definitely stand out in code better than a .dup swamped 
somewhere inconspicuous.
    
    
More information about the Digitalmars-d
mailing list