iterators again

Bruno Medeiros brunodomedeiros+spam at com.gmail
Sat Jun 2 15:42:44 PDT 2007


Walter Bright wrote:
> Bruno Medeiros wrote:
>> Hum, you're right, it should type to const instead of invariant, I 
>> totally missed that. However I missed because I'm trying to look into 
>> another issue, what I really want to know is if the full type of 
>> (*(&foo)) will be the same as (foo), and so far it seems not, 
>> according to what Walter's said. So
>>   typeof(foo) is:  final Foo
>> but
>>   typeof(*(&foo)) is:  const(Foo)
>> which seems a breach in orthogonality, and meaning that this won't be 
>> allowed:
>>   (*(&foo)).membervar = 42;
> 
> final is not a type constructor, it is a storage class. And no, you 
> won't be able to change the contents of an instance of a final struct, 
> even if you do machinations to do so.

I should have clarified, Foo there is supposed to be a class, not a struct.

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list