commit 2025-10-17 16:45 add ZtCTypeChain::Size() : ZCppMain/ZMainHead.H
This commit is contained in:
@ -3240,6 +3240,9 @@ namespace ZNsMain
|
||||
enum{ZETypeNo = TypeChainNext::ZETypeNo+1};
|
||||
enum{ZEBoolNext = 1 };
|
||||
public:
|
||||
static ZTypIntE Size(){return ZETypeNo;}
|
||||
static ZTypIntE size(){return ZETypeNo;}
|
||||
public:
|
||||
|
||||
template<typename TViewChain> class ZtCIterChain
|
||||
{
|
||||
@ -3295,6 +3298,9 @@ namespace ZNsMain
|
||||
enum{ZETypeNo = 1};
|
||||
enum{ZEBoolNext = 0};
|
||||
public:
|
||||
static ZTypIntE Size(){return ZETypeNo;}
|
||||
static ZTypIntE size(){return ZETypeNo;}
|
||||
public:
|
||||
|
||||
template<typename TViewChain> class ZtCIterChain
|
||||
{
|
||||
@ -3345,6 +3351,53 @@ namespace ZNsMain
|
||||
void ZftIterTmplChainTail(TTypeView AO_View)
|
||||
*/
|
||||
|
||||
/*////////////////////////////////////////////////////////////////
|
||||
|
||||
■ ZtCTypeChain 예제.
|
||||
|
||||
|
||||
using namespace ZNsMain;
|
||||
|
||||
|
||||
class ZCTypeView
|
||||
{
|
||||
public:
|
||||
|
||||
template<typename TTypChain> void OnMeetType()
|
||||
{
|
||||
cout<<TTypChain::ZETypeNo<<" : "<<typeid(typename TTypChain::TypeData).name()<<endl;
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef ZtCTypeChain
|
||||
<
|
||||
double , ZtCTypeChain<
|
||||
int , ZtCTypeChain<
|
||||
wchar_t, ZtCTypeChain<
|
||||
char ,
|
||||
|
||||
ZCEmpty > > >
|
||||
> ZCTypeChain; ZCTypeView VO_ZCTypeView;
|
||||
|
||||
cout<<"temp chain size = "<<ZCTypeChain::Size()<<endl;
|
||||
|
||||
|
||||
ZftIterTmplChainTail<ZCTypeChain, ZCTypeView&>(VO_ZCTypeView);
|
||||
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::IterHead(VO_ZCTypeView);
|
||||
cout<<"************************************"<<endl;
|
||||
ZCTypeChain::ZtCIterChain<ZCTypeView>::IterTail(VO_ZCTypeView);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
-- 2025-10-17 16:42
|
||||
|
||||
////////////////////////////////////////////////////////////////*/
|
||||
|
||||
|
||||
|
||||
namespace ZNsTmplChain
|
||||
|
Reference in New Issue
Block a user