Bug 20266 – __ARGS__ for easy forwarding of function arguments

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-10-04T01:34:59Z
Last change time
2022-07-04T16:56:00Z
Assigned to
No Owner
Creator
Andrej Mitrovic

Comments

Comment #0 by andrej.mitrovich — 2019-10-04T01:34:59Z
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__); ... } -----
Comment #1 by andrej.mitrovich — 2019-10-04T02:03:06Z
I've renamed the keyword to __ARGS__, as I think that makes more sense. It's not in use currently right?
Comment #2 by andrej.mitrovich — 2022-07-04T16:56:00Z
*** This issue has been marked as a duplicate of issue 22291 ***