GoingNative 2012 to be livestreamed tomorrow - part 2

bearophile bearophileHUGS at lycos.com
Fri Feb 10 16:47:52 PST 2012


Timon Gehr:

> I'm not sure what you are saying here.

I meant using something like this, instead of a template:

bool IsNumberWithError(T, string file=__FILE__, int line=__LINE__)() {
      enum bool result = is( ...
      if (!result)
          __ctfeWriteln(file, "(", line, "): '", typeid(T), "' is not a number.");
    return result;
}


> So does __ctfeWriteln.

I know, but I hope __ctfeWriteln will become __ctfeWrite or someone will write a __ctfeWrite too. See the pull request for discussions about this. Having no way to avoid the ending newline is awful, it forces me to build large strings with appends and print them all at once instead of using just a series or writes. Not having an ending newline was my first requirement for an acceptable compile-time printing function.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list