mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-12-14 00:40:55 +08:00
57 lines
979 B
C++
57 lines
979 B
C++
|
#pragma once
|
|||
|
#include "acl_cpp/acl_cpp_define.hpp"
|
|||
|
|
|||
|
namespace acl {
|
|||
|
|
|||
|
#ifdef WIN32
|
|||
|
template<typename TDerive, typename TProvider>
|
|||
|
class final_tpl_base
|
|||
|
{
|
|||
|
friend TDerive;
|
|||
|
friend TProvider;
|
|||
|
private:
|
|||
|
final_tpl_base() {}
|
|||
|
~final_tpl_base() {}
|
|||
|
};
|
|||
|
#else
|
|||
|
template <typename T>
|
|||
|
class identity
|
|||
|
{
|
|||
|
public:
|
|||
|
typedef T me;
|
|||
|
};
|
|||
|
|
|||
|
template<typename TDerive, typename TProvider>
|
|||
|
class final_tpl_base
|
|||
|
{
|
|||
|
friend class identity<TDerive>::me;
|
|||
|
friend class identity<TProvider>::me;
|
|||
|
private:
|
|||
|
final_tpl_base() {}
|
|||
|
~final_tpl_base() {}
|
|||
|
};
|
|||
|
#endif
|
|||
|
|
|||
|
/*
|
|||
|
* <EFBFBD>ṩ<EFBFBD><EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD>,<EFBFBD><EFBFBD>Ҫ<EFBFBD>˹<EFBFBD><EFBFBD>ܵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>final_tpl<EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊģ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @example:
|
|||
|
* class my_final_class : public acl::final_tpl <my_final_class>
|
|||
|
* {
|
|||
|
* public:
|
|||
|
* my_final_class() {}
|
|||
|
* ~my_final_class() {}
|
|||
|
* }
|
|||
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD>֤<EFBFBD><EFBFBD> my_final_class <EFBFBD>Dz<EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD>̳е<EFBFBD>
|
|||
|
*/
|
|||
|
template<typename TFinalClass>
|
|||
|
class final_tpl : virtual public final_tpl_base<TFinalClass,
|
|||
|
final_tpl<TFinalClass> >
|
|||
|
{
|
|||
|
public:
|
|||
|
final_tpl() {}
|
|||
|
~final_tpl() {}
|
|||
|
};
|
|||
|
|
|||
|
}
|