[Issue 20266] New: __PARAMETERS__ for easy forwarding of function arguments

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 4 01:34:59 UTC 2019


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

          Issue ID: 20266
           Summary: __PARAMETERS__ for easy forwarding of function
                    arguments
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: andrej.mitrovich at gmail.com

I often find myself wanting to forward arguments to another function, most
commonly for logging. For example:

-----
void setupTimer ( ulong index, ulong timer_id, Duration duration )
{
    log.trace(__FUNCTION__, index, timer_id, duration);

    ...
}
-----

But I always have to pass the parameters manually. It would be very convenient
if I could write it like this:

-----
void setupTimer ( ulong index, ulong timer_id, Duration duration )
{
    log.trace(__FUNCTION__, __PARAMETERS__);

    ...
}
-----

--


More information about the Digitalmars-d-bugs mailing list