__FUNCTION__
Jarrett Billingsley
jarrett.billingsley at gmail.com
Sat Feb 28 14:27:27 PST 2009
On Sat, Feb 28, 2009 at 5:24 PM, Derek Parnell <derek at psych.ward> wrote:
> On Sat, 28 Feb 2009 12:30:35 -0500, Jarrett Billingsley wrote:
>
>> Can we get this please? It's so simple and would be terribly useful.
>
> void foo()
> {
> writefln(__FUNCTION__);
> }
>
> void foo(int x)
> {
> writefln(__FUNCTION__);
> }
>
> -------------------
>
> module bar;
> void foo()
> {
> writefln(__FUNCTION__);
> }
>
> ----------------
>
> class One
> {
> void foo()
> {
> writefln(__FUNCTION__);
> }
> }
>
>
> struct Two
> {
> void foo()
> {
> writefln(__FUNCTION__);
> }
> }
>
> --------------
>
> Any problems so far?
I mentioned in a follow-up post that it would probably have to give a
fully-qualified name in the presence of multiple modules and nesting
and such. As for multiple overloads - so what? All I want is the
name of the function.
More information about the Digitalmars-d
mailing list