Re: Is there a way to do the same thing in entry and return of a bunch of functions?

2019-09-18 Thread Stefanos Baziotis via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 01:03:27 UTC, Nicholas Wilson wrote: I think a mixin that does string LOG_SCOPE = q{ callDepth++; scope(exit) callDepth--; } is probably the easiest. for bonus points string LOG_SCOPE = q{ callDepth++; debug_log(__FUNCTION__);// or __PRETTY_FUNTION__

Re: Is there a way to do the same thing in entry and return of a bunch of functions?

2019-09-17 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 17 September 2019 at 17:11:09 UTC, Stefanos Baziotis wrote: I think it's better to give a concrete example rather than explaining this vaguely. -- The question -- Can we do better ? For one, I believe that because D does not have a preprocessor, we have to do an actual declaration