Sorting in D Blog Post Review Request

ag0aep6g via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 4 10:16:09 PDT 2017


On 06/04/2017 06:07 PM, Mike Parker wrote:
> https://gist.github.com/mdparker/51599471b5f19fe05ff01ca95b34d453

 From there: "What it boils down to is this: if a function *can* be 
executed at compile time, it *will* be."

I think that gives the wrong impression. We regularly have newcomers in 
D.learn who expect CTFE to happen where it doesn't. They have a function 
call with all compile-time constants, and they expect it to be handled 
by CTFE. They think that the call *can* be evaluated at compile time, so 
it *will* be. But that's not how it works. CTFE only kicks in when the 
destination *requires* a compile-time constant.


More information about the Digitalmars-d mailing list