On 6/1/2018 12:30 AM, Mike Franklin wrote:
I already have a pending PR at https://github.com/dlang/dmd/pull/8310 which I
can modify to fix for both __LINE__ and __FILE_ if I can get clarification on
how it *should* work.
I followed up there. Thanks for taking care of this!
On Friday, 1 June 2018 at 03:14:11 UTC, Walter Bright wrote:
On 5/30/2018 2:45 PM, John Colvin wrote:
https://run.dlang.io/is/oMe7KQ
Less elegant, but solves the problem of accidental argument
adding (CallerFile acts as a barrier). Unfortunately, while it
works in theory, in practice the comp
On 5/30/2018 1:27 AM, FeepingCreature wrote:
There's a very common idiom where in order to report line numbers of an error or
a log line at the callsite of a function, you pass __FILE__ and __LINE__ as
default parameters:
void foo(string file = __FILE__, size_t line = __LINE__);
What's wrong
On 5/30/2018 2:45 PM, John Colvin wrote:
https://run.dlang.io/is/oMe7KQ
Less elegant, but solves the problem of accidental argument adding (CallerFile
acts as a barrier). Unfortunately, while it works in theory, in practice the
compiler crashes LOL
Please post bug reports when you find c
On 5/31/18 7:14 AM, bauss wrote:
Instead of these hack keywords.
Perhaps a __traits() in the compiler with the information would be
better suited like:
void foo()
{
enum caller = __traits(getCaller);
}
getCaller would return a compile-time struct with additional information
On Wednesday, 30 May 2018 at 14:40:50 UTC, Steven Schveighoffer
wrote:
On 5/30/18 4:27 AM, FeepingCreature wrote:
There's a very common idiom where in order to report line
numbers of an error or a log line at the callsite of a
function, you pass __FILE__ and __LINE__ as default parameters:
vo
On Wednesday, 30 May 2018 at 14:40:50 UTC, Steven Schveighoffer
wrote:
On 5/30/18 4:27 AM, FeepingCreature wrote:
There's a very common idiom where in order to report line
numbers of an error or a log line at the callsite of a
function, you pass __FILE__ and __LINE__ as default parameters:
vo
On 05/30/2018 10:40 AM, Steven Schveighoffer wrote:
But if we fixed the behavior that causes your idea not to work, then we
could probably easily define a function like so:
CallerInfo __CALLER__(string file = __FILE__, size_t line = __LINE__)
{
return CallerInfo(file, line);
}
Love it
On 5/30/18 10:40 AM, Steven Schveighoffer wrote:
But if we fixed the behavior that causes your idea not to work, then we
could probably easily define a function like so:
CallerInfo __CALLER__(string file = __FILE__, size_t line = __LINE__)
{
return CallerInfo(file, line);
}
Filed an issu
On 5/30/18 4:27 AM, FeepingCreature wrote:
There's a very common idiom where in order to report line numbers of an
error or a log line at the callsite of a function, you pass __FILE__ and
__LINE__ as default parameters:
void foo(string file = __FILE__, size_t line = __LINE__);
What's wrong wi
On Wednesday, 30 May 2018 at 11:59:05 UTC, bauss wrote:
On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature
wrote:
There's a very common idiom where in order to report line
numbers of an error or a log line at the callsite of a
function, you pass __FILE__ and __LINE__ as default paramete
On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature wrote:
There's a very common idiom where in order to report line
numbers of an error or a log line at the callsite of a
function, you pass __FILE__ and __LINE__ as default parameters:
[...]
void foo(string file = __FILE__, size_t lin
Shit it doesn't work, I only checked if it compiled; it gives the
wrong file/line number.
NEVERMIND ALL
On 30/05/2018 8:27 PM, FeepingCreature wrote:
There's a very common idiom where in order to report line numbers of an
error or a log line at the callsite of a function, you pass __FILE__ and
__LINE__ as default parameters:
void foo(string file = __FILE__, size_t line = __LINE__);
What's wrong
There's a very common idiom where in order to report line numbers
of an error or a log line at the callsite of a function, you pass
__FILE__ and __LINE__ as default parameters:
void foo(string file = __FILE__, size_t line = __LINE__);
What's wrong with this?
Say you add a string parameter, su
15 matches
Mail list logo