Is this actually supposed to be legal?

Timon Gehr timon.gehr at gmx.ch
Wed Jul 18 15:11:53 PDT 2012


On 07/18/2012 01:37 AM, Jonathan M Davis wrote:
> On Tuesday, July 17, 2012 23:11:43 Timon Gehr wrote:
>> This issue is unrelated to CRTP. (also, you probably want to negate
>> that static if condition, otherwise the code is valid and poses no
>> challenge to a compiler.)
>
> It's not that it makes the compiler's life hard. It's the fact that
> conditional compilation relies on state that doesn't exist yet. It's messed up
> to be checking whether an object defines something when you're in the middle of
> defining that object.
> ...

Declarations in D are declarative. There is no notion of state.



More information about the Digitalmars-d-learn mailing list