This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Macro __FUNCTION__ in C++
- To: egcs at cygnus dot com
- Subject: Macro __FUNCTION__ in C++
- From: Ryszard Kabatek <rysio at rumcajs dot chemie dot uni-halle dot de>
- Date: Sun, 13 Sep 1998 11:00:52 +0200 (CEST)
The macro __FUNCTION__, or in C9X draft the identifier __func__,
returns the name of the current function without
the namespace and without the argument types.
It's good for the C language, but in C++ would be useful something like:
namespace A {
class B {
public:
void calc(int x, double y) const {cout << __FUNCTION__ << '\n'; /**/}
};
}
'::A::B::calc(int, double) const' instead of 'calc'
Ryszard Kabatek
Martin-Luther University Halle-Wittenberg
Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129
e-mail: kabatek@chemie.uni-halle.de