2019-07-28 10:31:56 +08:00
|
|
|
|
#pragma once
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../acl_cpp_define.hpp"
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
2015-06-29 17:33:11 +08:00
|
|
|
|
#if defined(_WIN32) || defined(_WIN64)
|
2014-11-19 00:25:21 +08:00
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
/*
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <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>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
* @example:
|
|
|
|
|
* class my_final_class : public acl::final_tpl <my_final_class>
|
|
|
|
|
* {
|
|
|
|
|
* public:
|
|
|
|
|
* my_final_class() {}
|
|
|
|
|
* ~my_final_class() {}
|
|
|
|
|
* }
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD>֤<EFBFBD><EFBFBD> my_final_class <EFBFBD>Dz<EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD>̳е<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
template<typename TFinalClass>
|
|
|
|
|
class final_tpl : virtual public final_tpl_base<TFinalClass,
|
|
|
|
|
final_tpl<TFinalClass> >
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
final_tpl() {}
|
|
|
|
|
~final_tpl() {}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|