Evaluating __FILE__ and __LINE__ of caller?
Jonathan M Davis
jmdavisProg at gmx.com
Sat Mar 3 17:56:57 PST 2012
On Saturday, March 03, 2012 23:01:38 Andrej Mitrovic wrote:
> On 3/3/12, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> > Of course, with D's templates, CTFE, and compile-time introspection
> > capabilities, I can't imagine when autogeneration would actually be
> > required, but we're talking about hypotheticals here.
>
> It can be if you need an OOP D binding to a C/C++ library. E.g. QtD
> uses an autogenerator, GtkD as well.
All it takes is a function passing a size_t to that function rather than
letting it use its default value, and you'll get problems on 64-bit systems if
you made the line number an int. It really needs to be a size_t, even if
you'll never have a value for it which is high enough to need it.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list