iterators again
Walter Bright
newshound1 at digitalmars.com
Sat Jun 2 15:01:31 PDT 2007
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.
More information about the Digitalmars-d
mailing list