Topic: __func__ improvement for namespaces


Author: Constantin-Flavius Nistor <costelnistor12@gmail.com>
Date: Mon, 21 Aug 2017 19:03:43 -0700 (PDT)
Raw View
------=_Part_6094_1034632549.1503367423715
Content-Type: multipart/alternative;
 boundary="----=_Part_6095_1035356219.1503367423716"

------=_Part_6095_1035356219.1503367423716
Content-Type: text/plain; charset="UTF-8"

The main problem is that the current *__func__ *preprocessor macro is
pretty much useless if using namespaces and overloaded functions:
namespace My::Defined::Namespace::Name::Is::Not
{
    void Shown( int unused = 0 ) { std::cout << __func__ << std::endl; }
}

namespace My::Defined::Namespace::Name::Is::Still::Not
{
    void Shown( int unused = 0 ) { std::cout << __func__ << std::endl; }
}

int main( )
{
    My::Defined::Namespace::Name::Is::Not::Shown( );
    My::Defined::Namespace::Name::Is::Still::Not::Shown( );
    return 1;
}

prints just
Shown
Shown

If that would be a big project with many similar function names we wouldn't
be able to tell where they come from exactly (well, without using *__FILE__
*and *__LINE__*). That preprocessor macro could be ideally used for easily
adding debug messages without those downsides, so it should ideally print
something similar to
void My::Defined::Namespace::Name::Is::Not::Shown( int )
void My::Defined::Namespace::Name::Is::Still::Not::Shown( int )
(maybe for the return type and argument types another similar preprocessor
macro should be added)

If you won't modify this preprocessor macro (backwards compatibility ? I
don't think that's the case for this one), maybe we could have another one
for a version similar to the example output I wrote above ? Maybe some
*__func_pretty__ *or anything similar.

* Don't suggest me any compiler extension, I know about them. GCC has *__PRETTY_FUNCTION__
*and VS has *__FUNCDNAME__ *and *__FUNCSIG__*. Using *#if #else if #else
#endif* or any workaround to use any existing extension of the used
compiler can be unpleasant if wanting to do some simple debug lines to work
on multiple compilers.

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d63b0ba3-dd0f-428d-a4c1-b0a672f94bd3%40isocpp.org.

------=_Part_6095_1035356219.1503367423716
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">The main problem is that the current <i>__func__=C2=A0</i>=
preprocessor macro is pretty much useless if using namespaces and overloade=
d functions:<div><div class=3D"prettyprint" style=3D"background-color: rgb(=
250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bord=
er-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div cla=
ss=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">namespace</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">My</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #606;" class=3D"styled-by-prettify">Defined</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"=
color: #606;" class=3D"styled-by-prettify">Namespace</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #6=
06;" class=3D"styled-by-prettify">Name</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">::</span><span style=3D"color: #606;" class=3D"=
styled-by-prettify">Is</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">::</span><span style=3D"color: #606;" class=3D"styled-by-pretti=
fy">Not</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #606;" class=3D"styled-by-prettify">Shown</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" =
class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> unused </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">0</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">cout </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> __func__ </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>endl</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br><br></span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">namespace</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styl=
ed-by-prettify">My</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">::</span><span style=3D"color: #606;" class=3D"styled-by-prettify">=
Defined</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::<=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Namespace</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">Name</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"co=
lor: #606;" class=3D"styled-by-prettify">Is</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">::</span><span style=3D"color: #606;" clas=
s=3D"styled-by-prettify">Still</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">::</span><span style=3D"color: #606;" class=3D"styled-b=
y-prettify">Not</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">vo=
id</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #606;" class=3D"styled-by-prettify">Shown</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> unused </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-=
prettify">0</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">cout </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> __func__ </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">endl</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br><br></span><span style=3D"color: #008;"=
 class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> main</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </spa=
n><span style=3D"color: #606;" class=3D"styled-by-prettify">My</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D=
"color: #606;" class=3D"styled-by-prettify">Defined</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #60=
6;" class=3D"styled-by-prettify">Namespace</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">::</span><span style=3D"color: #606;" class=
=3D"styled-by-prettify">Name</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #606;" class=3D"styled-by-=
prettify">Is</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">::</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Not</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #606;" class=3D"styled-by-prettify">Shown</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #606=
;" class=3D"styled-by-prettify">My</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #606;" class=3D"styl=
ed-by-prettify">Defined</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Namespace</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">::</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Name=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><=
span style=3D"color: #606;" class=3D"styled-by-prettify">Is</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"co=
lor: #606;" class=3D"styled-by-prettify">Still</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #606;" c=
lass=3D"styled-by-prettify">Not</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">::</span><span style=3D"color: #606;" class=3D"styled-=
by-prettify">Shown</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">}</span></div></code></div><br><div>prints just=
</div><div><div class=3D"prettyprint" style=3D"background-color: rgb(250, 2=
50, 250); border-color: rgb(187, 187, 187); border-style: solid; border-wid=
th: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"=
subprettyprint"><span style=3D"color: #606;" class=3D"styled-by-prettify">S=
hown</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></=
span><span style=3D"color: #606;" class=3D"styled-by-prettify">Shown</span>=
</div></code></div><br>If that would be a big project with many similar fun=
ction names we wouldn&#39;t be able to tell where they come from exactly (w=
ell, without using <i>__FILE__ </i>and <i>__LINE__</i>). That preprocessor=
=C2=A0macro could be ideally used for easily adding debug messages without =
those downsides, so it should ideally print something similar to</div><div>=
<div><div class=3D"prettyprint" style=3D"border-width: 1px; border-style: s=
olid; border-color: rgb(187, 187, 187); background-color: rgb(250, 250, 250=
); word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpre=
ttyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">void</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
 style=3D"color: #606;" class=3D"styled-by-prettify">My</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #606;" class=3D"styled-by-prettify">Defined</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #606;" c=
lass=3D"styled-by-prettify">Namespace</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">::</span><span style=3D"color: #606;" class=3D"s=
tyled-by-prettify">Name</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Is</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::<=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Not</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span sty=
le=3D"color: #606;" class=3D"styled-by-prettify">Shown</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">void<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">My</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #606;" class=3D"styled-by-prettify">Defined</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #606;" c=
lass=3D"styled-by-prettify">Namespace</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">::</span><span style=3D"color: #606;" class=3D"s=
tyled-by-prettify">Name</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Is</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::<=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Still</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span s=
tyle=3D"color: #606;" class=3D"styled-by-prettify">Not</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: =
#606;" class=3D"styled-by-prettify">Shown</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">)=
</span></div></code></div>(maybe for the return type and argument types ano=
ther similar preprocessor macro should be added)<br></div></div><div><br></=
div><div>If you won&#39;t modify this preprocessor=C2=A0macro (backwards co=
mpatibility ? I don&#39;t think that&#39;s the case for this one), maybe we=
 could have another one for a version similar to the example output I wrote=
 above ? Maybe some <i>__func_pretty__=C2=A0</i>or anything similar.</div><=
div><br></div>* Don&#39;t suggest me any compiler extension, I know about t=
hem. GCC has <i>__PRETTY_FUNCTION__ </i>and VS has <i>__FUNCDNAME__ </i>and=
 <i>__FUNCSIG__</i>. Using <i>#if #else if #else #endif</i> or any workarou=
nd to use any existing extension of the used compiler can be unpleasant if =
wanting to do some simple debug lines to work on multiple compilers.</div><=
/div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/d63b0ba3-dd0f-428d-a4c1-b0a672f94bd3%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/d63b0ba3-dd0f-428d-a4c1-b0a672f94bd3=
%40isocpp.org</a>.<br />

------=_Part_6095_1035356219.1503367423716--

------=_Part_6094_1034632549.1503367423715--

.


Author: Daemon Snake <swac31@gmail.com>
Date: Tue, 22 Aug 2017 17:47:12 -0700 (PDT)
Raw View
------=_Part_4859_1670101873.1503449232617
Content-Type: multipart/alternative;
 boundary="----=_Part_4860_1425674296.1503449232617"

------=_Part_4860_1425674296.1503449232617
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Le mardi 22 ao=C3=BBt 2017 04:03:43 UTC+2, Constantin-Flavius Nistor a =C3=
=A9crit :
>
> The main problem is that the current *__func__ *preprocessor macro is=20
> pretty much useless if using namespaces and overloaded functions:
>
1. __func__ is not a macro.
    *"C99 introduced **__func__, ... Both of these are strings containing=
=20
the name of the current function ...*
*     Neither of them is a macro; the preprocessor does not know the name=
=20
of the current function."*
      https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html

2. __func__ is there for C compatibility,
      the C standard defines it as function name only and that's all. It's=
=20
not meant to be useful in C++.

3. Reflection
      The reflection group is working on having a full static reflection=20
which renders your proposal useless. (meta classes, reflexpr, etc...).
      For instance : https://godbolt.org/g/HBHmEC.
      You could ask for $__func__ though.

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/cf49224e-393e-4375-a4f3-155d4c7577e5%40isocpp.or=
g.

------=_Part_4860_1425674296.1503449232617
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Le mardi 22 ao=C3=BBt 2017 04:03:43 UTC+2, Constantin-Flav=
ius Nistor a =C3=A9crit=C2=A0:<blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">=
<div dir=3D"ltr">The main problem is that the current <i>__func__=C2=A0</i>=
preprocessor macro is pretty much useless if using namespaces and overloade=
d functions:</div></blockquote><div>1. __func__ is not a macro.</div><div><=
span style=3D"color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;=
; font-size: medium;">=C2=A0 =C2=A0 <i>&quot;C99 introduced=C2=A0</i></span=
><i><code style=3D"color: rgb(0, 0, 0);">__func__</code><span style=3D"colo=
r: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font-size: mediu=
m;">, ...=C2=A0</span><span style=3D"color: rgb(0, 0, 0); font-family: &quo=
t;Times New Roman&quot;; font-size: medium;">Both of these are strings cont=
aining the name of the current function ...</span></i></div><div><i><span s=
tyle=3D"color: rgb(0, 0, 0); font-family: &quot;Times New Roman&quot;; font=
-size: medium;">=C2=A0 =C2=A0 =C2=A0Neither of them is a macro; the preproc=
essor does not know the name of the current function.</span>&quot;</i></div=
><div>=C2=A0 =C2=A0 =C2=A0=C2=A0<a href=3D"https://gcc.gnu.org/onlinedocs/c=
pp/Standard-Predefined-Macros.html">https://gcc.gnu.org/onlinedocs/cpp/Stan=
dard-Predefined-Macros.html</a><br></div><div><br></div><div>2. __func__ is=
 there for C compatibility,</div><div>=C2=A0 =C2=A0 =C2=A0 the C standard d=
efines it as function name only and that&#39;s all. It&#39;s not meant to b=
e useful in C++.</div><div><br></div><div>3. Reflection</div><div>=C2=A0 =
=C2=A0 =C2=A0 The reflection group is working on having a full static refle=
ction which renders your proposal useless. (meta classes, reflexpr, etc...)=
..</div><div>=C2=A0 =C2=A0 =C2=A0 For instance :=C2=A0<a href=3D"https://god=
bolt.org/g/HBHmEC">https://godbolt.org/g/HBHmEC</a>.</div><div>=C2=A0 =C2=
=A0 =C2=A0 You could ask for $__func__ though.</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/cf49224e-393e-4375-a4f3-155d4c7577e5%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/cf49224e-393e-4375-a4f3-155d4c7577e5=
%40isocpp.org</a>.<br />

------=_Part_4860_1425674296.1503449232617--

------=_Part_4859_1670101873.1503449232617--

.