CTFE output is kind of weired

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Jul 8 21:03:09 PDT 2017


On Sat, Jul 08, 2017 at 03:09:09PM -0700, Ali Çehreli via Digitalmars-d-learn wrote:
> On 07/08/2017 02:29 PM, Andre Pany wrote:
> 
> > I use assert(false, tmp) to see the content of variable tmp as it
> > seems there is no other way in CTFE.
> 
> A more natural way is pragma(msg), which you can use in main in this
> case:
[...]

Unfortunately, pragma(msg) can only be used *after* CTFE has finished.
It's not possible to print the message *during* CTFE.

Stefan Koch allegedly will add a ctfeWriteln to his new CTFE engine that
should alleviate this limitation.


T

-- 
There is no gravity. The earth sucks.


More information about the Digitalmars-d-learn mailing list