https://issues.dlang.org/show_bug.cgi?id=17593

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from [email protected] ---
I manage to make the feature working with a tuple after a quick hacking
session, with this code that compiles and runs and then displays the expected
result:

====
module runnable;

import std.stdio, std.typecons;

void foo(Tuple!(string, string, int) p = __POS__)
{
    writeln(p);
}

void main(string[] args)
{
    writeln(__POS__[0]);
    writeln(__POS__[1]);
    writeln(__POS__[2]);
    foo();
}
====

actually more can be added to the tuple. (here it's the equivalent of __FILE__,
__MODULE__ then __LINE__) since __PRETTY_FUNCTION__ is also important for
logging.


If DMD people agree on the principle of the feature I'm not against proposing a
PR. Also with a small bounty as motivation if possible.

--

Reply via email to