If only member function clear of WindowMgr is a friend of Screen, there are some points need to note. Sequence is important. First, define the WindowMgr class in WindowMgr.h, which declares, but cannot define clear function. Screen must be declared b…
//友元可以访问类的private与protected成员//友元关系不能继承-要明确授予友元 #include <iostream>//CppPrimer_友元与继承-txwtech--cc30a_demo using namespace std;//导入std名称空间 //友元可以访问类的private与protected成员 //友元关系不能继承-要明确授予友元 class Base //你爸爸 { friend class Frnd; friend class D2; protecte…
from:http://www.cnblogs.com/shijingxiang/articles/5389294.html 近日需要将线程池封装成C++类,类名为Threadpool.在类的成员函数exec_task中调用pthread_create去启动线程执行例程thread_rounter.编译之后报错如下: spfs_threadpool.cpp: In member function ‘int Threadpool::exec_task(task*)’: spfs_threadpoo…