X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Anthony" Newsgroups: comp.os.msdos.djgpp Subject: Inline functions question Date: Fri, 23 Apr 2004 18:08:41 +0400 Organization: Radio-MSU NOC, Moscow State University Lines: 45 Message-ID: NNTP-Posting-Host: integra.rmt.ru X-Trace: alpha2.radio-msu.net 1082729348 86921 81.13.30.150 (23 Apr 2004 14:09:08 GMT) X-Complaints-To: usenet AT radio-msu DOT net NNTP-Posting-Date: Fri, 23 Apr 2004 14:09:08 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hello, Why does this code #include class A { public: void f1(); inline void f2(const char* str); }; inline void A::f2(const char *str) { std::cout << "\n __func__ = " << __func__ << "\n __PRETTY_FUNCTION__ = " << __PRETTY_FUNCTION__ << "\n Caller = " << str; } void A::f1() { std::cout << "\n Now f1() will call f2()."; f2(__func__); } int main() { A a; a.f1(); } produces this: Now f1() will call f2(). __func__ = f2 <---- I expected f1 __PRETTY_FUNCTION__ = void A::f2(const char*) <---- I expected A::f2(...) Caller = f1 The f2() is supposed to be implanted in f1(), no? Thanks. Anthony.