Any word on the return-type const syntax?

Sean Kelly sean at f4.ca
Sun Dec 9 08:20:00 PST 2007


Walter Bright wrote:
> Janice Caron wrote:
>> But I think there's still a problem. If I write
>>
>>     class MyArray(T)
>>     {
>>         T[] a;
>>         TransferConst!(U,T*) ptr(this U)()
>>         {
>>             return a.ptr;
>>         }
>>     }
>>
>>     const MyArray!(int) aa;
>>     auto p = aa.ptr;
>>
>> Then presumably it won't compile, becase aa is not mutable,
> 
> Template member functions are not instantiated until they are called.

Or until they are aliased, to be pedantic.


Sean



More information about the Digitalmars-d mailing list