Latest const expansion

Bill Baxter dnewsgroup at billbaxter.com
Thu Sep 13 01:14:14 PDT 2007


Janice Caron wrote:
> On 9/13/07, Bruno Medeiros <brunodomedeiros+spam at com.gmail> wrote:
>> I think it would be
>> even better to have this:
>>
>> final const(T) - head/tail const
>> const(T)       - tail const
> 
> That's what we had in D2.0. That's what we've just got rid of.
> 
> Almost nobody likes the notion that const(T) should mean something
> different from const T. That idea has already been rejected as being
> too confusing.

I think const(T) was going to mean the same thing as const T for simple 
value types, no?

The thing that's confusing is that that it also means the same thing as 
just plain T for a simple value type.

That and the fact that this
    const(T)* foo;  // T's can't change pointer can.

is not the same as:
    alias const(T) S;  // S is same as a T, actually
    S* foo;   // no const here anymore.

.. or maybe it was the same... I can't remember what was what now.

--bb



More information about the Digitalmars-d mailing list