Re: Is MSDN wrong? or I made a mistake? about static member function
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Mon, 10 Jul 2006 14:47:09 -0500
On Mon, 10 Jul 2006 06:11:02 -0700, Fei Xu
<FeiXu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
in http://msdn2.microsoft.com/en-us/library/480b7kf7.aspx, it says that
pGdiObject->DeleteTempMap(); // Causes compiler error
But I'm confused for a static member can be called by the object or a pointer.
Is there anything wrong of my understanding?
Static member functions can be called using that syntax, but the object
reference or pointer isn't evaluated. So for a static member function, the
following are equivalent:
p->f();
T::f();
The second one is much better style.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: Is MSDN wrong? or I made a mistake? about static member function
- From: David Ching
- Re: Is MSDN wrong? or I made a mistake? about static member function
- Prev by Date: Re: a missing feature in VC debugger
- Next by Date: Re: list control
- Previous by thread: How to access member class of activex control
- Next by thread: Re: Is MSDN wrong? or I made a mistake? about static member function
- Index(es):
Relevant Pages
|