ref storage class in templates

Robert Fraser fraserofthenight at gmail.com
Wed Apr 16 12:33:19 PDT 2008


Regan Heath wrote:
> Janice Caron wrote:
>> How is that a bug? I certainly wouldn't have expected that to compile.
>> You can't pass "storage classes" to templates.
> 
> I suspect the confusion arises because 'const' is used as both a storage 
> class and as a type modifier.
> 
> eg.
> 
> const int a = 5;  //storage class
> void foo(const int a) {} //type modifier
> 
> and you can pass type modifiers to templates.
> 
> Regan

We need to get rid of const the type modifier and keep const the type 
constructor as the only way to do it. That would solve the return-type 
const problem, too



More information about the Digitalmars-d mailing list