On Phobos GC hunt

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 8 15:18:29 PDT 2014


On Wed, 08 Oct 2014 23:40:01 +0200
Timon Gehr via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> This is probably a regression somewhere after 2.060, because with
> 2.060 I get
> 
> Error: variable __ctfe cannot be read at compile time
> Error: expression __ctfe is not constant or does not evaluate to a
> bool
> 
> as I'd expect.
i remember now that i was copypasting toHash() from druntime some time
ago and changed "if (__ctfe)" to "static if (__ctfe)" in process. it
compiles and works fine, and i don't even noticed what i did until i
tried to change non-ctfe part of toHash() and found that my changes had
no effect at all. and then i discovered that "static".

this was 2.066 or 2.067-git.

and now i can clearly say that "static if (__ctfe)" leaving only ctfe
part.

that was somewhat confusing, as i was pretty sure that "if (__ctfe)"
*must* be used with "static".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141009/76b0a47f/attachment.sig>


More information about the Digitalmars-d mailing list