is there a way to get the identifier (call it name) of what is being passed to a function ?
Paul Backus
snarwin at gmail.com
Mon Jul 19 03:05:24 UTC 2021
On Monday, 19 July 2021 at 01:45:27 UTC, SealabJaster wrote:
> On Monday, 19 July 2021 at 01:26:25 UTC, someone wrote:
>> ...
>
> Not 100% sure this works in all cases, but this version doesn't
> need the caller to make use of a mixin:
> https://run.dlang.io/is/3jLxLz
If you only need to print variables, not arbitrary expressions,
then this approach is much nicer.
However, the mixin version is the only one that will work for
things like `debugWriteln!"x + y"`.
More information about the Digitalmars-d-learn
mailing list