Any word on the return-type const syntax?

Walter Bright newshound1 at digitalmars.com
Sat Dec 8 17:16:11 PST 2007


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.



More information about the Digitalmars-d mailing list