This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Macro __FUNCTION__ in C++



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]