auto storage class - infer or RAII?

Bill Baxter dnewsgroup at billbaxter.com
Mon Nov 13 15:20:59 PST 2006


Tomas Lindquist Olsen wrote:
> Bill Baxter wrote:
>> Tomas Lindquist Olsen wrote:
>>> Sean Kelly wrote:
>>>
>>> It is definitely a bit weird. I would like to see all combinations of 
>>> these fail. they dont make any sense together. all provide ATI if 
>>> present. the only problem I can see is if you want to put a constant 
>>> inside a static block. but maybe that is handled differently?
>>>
>>> IMHO this would make sense:
>>>
>>> Invalid:
>>> ---------
>>> static const x = 5;
>>
>> What's wrong with static and const together?
>> One says this is actually store with globals not on the stack, the 
>> other says the value isn't going to change.  Nothing inconsistent 
>> about having those two together.
> Does it really make sense to have the programmer decide this 
> distinction? A global const will definitely have static storage. But why 
>  not let the compiler decide?
> 
> I just don't see where having this choice is useful!

In a function?
In a class?

--bb



More information about the Digitalmars-d mailing list