读书人

请C++好手看看这个是什么意思?关于模

发布时间: 2013-08-01 15:23:18 作者: rapoo

请C++高手看看这个是什么意思?关于模板


class UI_AudioAuxControllerBase
: public UI_ControllerBase
, WeakSingleton<UI_AudioAuxControllerBase>//这个地方,的继承是什么意思????
{
//......
};

//下面的是模板类WeakSingleton
template <typename Type>
class WeakSingleton
{
public:
static Type& inst()
{
DCheckError(NULL != instance);

return *instance;
}

protected:
WeakSingleton()
{
DCheck(NULL == instance);

instance = (Type*)this;
}

private:
static Type* instance;
};

template<typename Type> Type* WeakSingleton<Type>::instance = NULL;
C++ 模板 派发 继承
[解决办法]
ATL 中的模板使用的技巧, 参考: http://www.myexception.cn/program/652624.html

读书人网 >C++

热点推荐