C++17 cannot beat D surely

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 3 23:18:40 PDT 2017


On Sun, Jun 04, 2017 at 06:08:28AM +0000, Stanislav Blinov via Digitalmars-d wrote:
> On Sunday, 4 June 2017 at 05:38:24 UTC, H. S. Teoh wrote:
> 
> > And if you need a particular functionality both at compile-time and
> > during runtime, there's no need to write it twice in two different
> > sublanguages. You just write one function once, and call it from
> > both CTFE and at runtime. It Just Works(tm).
> 
> ...except when you have `if (__ctfe)` :P

Ah, but if you want your function to work both at CTFE and runtime, then
why write `if (__ctfe)` in the first place? :-D

Unless, of course, you're optimizing for runtime with something that's
incompatible with CTFE, like inline assembly or something.  Then you're
on your own. :-D


T

-- 
People say I'm indecisive, but I'm not sure about that. -- YHL, CONLANG


More information about the Digitalmars-d mailing list