We need something like source_location in D
feepingcreature at gmail.com
Wed Sep 25 07:16:21 UTC 2019
On Tuesday, 24 September 2019 at 15:15:22 UTC, Stefan Koch wrote:
> On Tuesday, 24 September 2019 at 11:32:03 UTC, Jacob Carlborg
>> On Tuesday, 24 September 2019 at 10:36:53 UTC, guy hebert
>>> Have you got the solution.
>> A __traits has been implemented:
>> /Jacob Carlborg
> Does that solve the issue?
> can it stand in for the caller location?
No - how would you get the caller symbol? It's completely useless
for this purpose.
Personally I use Fence _ = Fence(), string file = __FILE__,
size_t line = __LINE__, but that's obviously awkward in that it's
Other things that don't work: void foo(Loc loc = Loc(__FILE__,
__LINE__)), because __FILE__ and __LINE__ are substituted by
explicitly checking whether the default value *is that symbol*.
They cannot be composed. That's why we do need something like
PS: You should ignore anyone on the topic unless they're linking
a run.dlang.io with working code.
More information about the Digitalmars-d