????????????????
?????????????????????????????????
????<code class="sourceCode cpp">class Std_interface {
????public:
????virtual void suspend() = 0;
????};
????// define the pointer of function
????typedef void (Std_interface::* Pstd_mem) ()
????void f(Std_interface* p) {
????Pstd_mem s = &Std_interface::suspend;
????// call directly
????p->suspend();
????// by pointer
????(p->*s)();
????}</code>
????????????????????????????????????????????????????::???????????????????ú???????????????????????
???????ú???????????????????????????????????????????????????????????????????????????????????????
???????????
????????????????????????????????????????????????????????????????????????static ????????????????
?????????????this????????ú??? ????????????г??
??????????????ú?????????????????????У????????′???
????<code class="sourceCode cpp">// GlAnimator.h
????class GlAnimator {
????public:
????int example();
????friend int LoopInThread(GlAnimator *animator_ptr);
????};
????// GlAnimator.cpp
????typedef int(*InnerLoop)(GlAnimator *);
????int GlAnimator::example() {
????InnerLoop inner_loop = &LoopInThread;
????return 0;
????}
????// friend function
????int LoopInThread(GlAnimator *animator_ptr) {
????// ...
????return 0;
????}</code>
????InnerLoop inner_loop = &LoopInThread; ??????????"LoopInThread undeclared" ??????????????????????????????!???????????????????????????????????????????example()????????????????????????????????
???????????????????????飬??????????飬???????????????????????????????????????????????£?
????<code class="sourceCode cpp">// GlAnimator.h
????class GlAnimator {
????public:
????int example();
????friend int LoopInThread(GlAnimator *animator_ptr);
????};
????// declare the friend function again
????int LoopInThread(GlAnimator *animator_ptr);</code>