Logical const
    Jesse Phillips 
    jessekphillips+D at gmail.com
       
    Mon Nov 29 19:05:09 PST 2010
    
    
  
Jesse Phillips Wrote:
> So what you are saying is that Mutable should not work on value types right? So if we make these assertions:
> 
> 	static assert(!__traits(compiles, new class { Mutable!int n; }));
> 	immutable A a = new immutable(A);
> 	int i = 8;
> 	static assert(!__traits(compiles, a.n = &i));
> 	static assert(__traits(compiles, *a.n = i));
> 	static assert(__traits(compiles, bar(a.n)));
> 
> The last one being what I believe to be an alias this bug, the rest assert correctly:
> 
> https://gist.github.com/721066
Oops didn't give the full context of my assertions (though it is available in the gist:
void bar( int n ) {}
class A {
     Mutable!(int*) n;
}
    
    
More information about the Digitalmars-d
mailing list