Shouldn't __traits return Tuples?

Trass3r mrmocool at gmx.de
Wed Apr 1 15:07:56 PDT 2009


Max Samukha schrieb:
> On Wed, 01 Apr 2009 23:22:40 +0200, Trass3r <mrmocool at gmx.de> wrote:
> 
>> OMG, I knew the recursion base case was missing, but I couldn't imagine 
>> how to represent "nothing". Of course, an empty tuple.
>>
>> But the reason I posted is cause that bug(?) is still present.
>> dmd doesn't crash anymore, but using const still doesn't work.
> 
> I think it's not a bug because "const" storage class doesn't always
> mean "compile time". It's rather a variable (we should find a better
> name) which is initialized once and cannot be changed later. To ensure
> compiletimeness, you can declare the variable as "static const",
> "static invariant" or "enum"

Man, static is one of the things that are totally confusing. It has 
various meanings depending on where you use it and moreover it's hard to 
find documentation about the one you need cause it's spread all over the 
docs.

But what you are talking about is in fact what "final" does (once 
initialized it can't be changed).



More information about the Digitalmars-d mailing list