commit 2025-10-17 12:26 add ZtCTypeChain in ZCppMain/ZMainHead.H
This commit is contained in:
@ -1624,7 +1624,7 @@ namespace ZNsMain
|
||||
|
||||
지금은 template 인수가 Type13 까지 있다. 그러면 Type12 까지 전문화할 수 있는 것이다. -- 2025-09-07 12:55
|
||||
|
||||
■ 이젠 ZtStTuple<int> 형태도 가능하다. ZftMakeTuple() 도 추가. - -2025-09-05 21:01
|
||||
이젠 ZtStTuple<int> 형태도 가능하다. ZftMakeTuple() 도 추가. - -2025-09-05 21:01
|
||||
|
||||
■ RVO(Return Value Optimization) 로 인해 아래가 가능하다. -- 2025-09-06 21:23
|
||||
|
||||
@ -3226,6 +3226,127 @@ namespace ZNsMain
|
||||
|
||||
|
||||
|
||||
template< typename TTypeNow, typename TTypeNextChain
|
||||
>
|
||||
class ZtCTypeChain ///////////////////////////////////
|
||||
{
|
||||
public :
|
||||
typedef TTypeNow TypeData ;
|
||||
typedef ZtCTypeChain TypeChainNow ;
|
||||
typedef TTypeNextChain TypeChainNext ;
|
||||
/************************************************************/
|
||||
typedef typename TypeChainNext::TypeData TypeNext ;
|
||||
/************************************************************/
|
||||
enum{ZETypeNo = TypeChainNext::ZETypeNo+1};
|
||||
enum{ZEBoolNext = 1 };
|
||||
public:
|
||||
|
||||
template<typename TViewChain> class ZtCIterChain
|
||||
{
|
||||
public:
|
||||
static void IterHead(TViewChain AO_CView)
|
||||
{
|
||||
AO_CView.template OnMeetType<TypeChainNow>();
|
||||
|
||||
if(TypeChainNow::ZEBoolNext>0)
|
||||
{
|
||||
TypeChainNext::template
|
||||
ZtCIterChain<TViewChain>::IterHead(AO_CView);
|
||||
}/*
|
||||
if(TypeChainNow::ZEBoolNext>0)*/
|
||||
}/*
|
||||
static void IterHead(TViewChain AO_CView)*/
|
||||
static void IterTail(TViewChain AO_CView)
|
||||
{
|
||||
if(TypeChainNow::ZEBoolNext>0)
|
||||
{
|
||||
TypeChainNext::template
|
||||
ZtCIterChain<TViewChain>::IterTail(AO_CView);
|
||||
}/*
|
||||
if(TypeChainNow::ZEBoolNext>0)*/
|
||||
|
||||
AO_CView.template OnMeetType<TypeChainNow>();
|
||||
}/*
|
||||
static void IterTail(TViewChain AO_CView)*/
|
||||
public:
|
||||
};/*
|
||||
template<typename TViewChain> class ZtCIterChain*/
|
||||
|
||||
public:
|
||||
};/*
|
||||
template< typename TTypeNow, typename TTypeNextChain
|
||||
>
|
||||
class ZtCTypeChain /////////////////////////////////*/
|
||||
|
||||
|
||||
template<typename TTypeNow> class ZtCTypeChain<TTypeNow, ZCEmpty>
|
||||
{
|
||||
public :
|
||||
/************************************************************/
|
||||
typedef ZtCTypeChain <TTypeNow, ZCEmpty> ZCTypeChain;
|
||||
/************************************************************/
|
||||
public :
|
||||
typedef TTypeNow TypeData;
|
||||
public :
|
||||
typedef typename ZCTypeChain TypeChainNow ;
|
||||
typedef typename ZCTypeChain TypeChainNext;
|
||||
typedef typename ZCEmpty TypeNext ;
|
||||
public :
|
||||
enum{ZETypeNo = 1};
|
||||
enum{ZEBoolNext = 0};
|
||||
public:
|
||||
|
||||
template<typename TViewChain> class ZtCIterChain
|
||||
{
|
||||
public:
|
||||
static void IterHead(TViewChain AO_CView)
|
||||
{ AO_CView.template OnMeetType<TypeChainNow>(); }
|
||||
static void IterTail(TViewChain AO_CView)
|
||||
{ AO_CView.template OnMeetType<TypeChainNow>(); }
|
||||
public:
|
||||
};/*
|
||||
template<typename TViewChain> class ZtCIterChain*/
|
||||
};/*
|
||||
template<typename TTypeNow> class ZtCTypeChain<TTypeNow, ZCEmpty>*/
|
||||
|
||||
|
||||
template<typename TTmplChain, typename TTypeView>
|
||||
void ZftIterTmplChainHead(TTypeView AO_View)
|
||||
{
|
||||
AO_View.template OnMeetType<TTmplChain>();
|
||||
|
||||
if(TTmplChain::ZEBoolNext>0)
|
||||
{
|
||||
typedef typename
|
||||
TTmplChain::TypeChainNext TypeChainNext;
|
||||
|
||||
ZftIterTmplChainHead<TypeChainNext, TTypeView>(AO_View);
|
||||
}/*
|
||||
if(TTmplChain::ZEBoolNext>0)*/
|
||||
}/*
|
||||
template<typename TTmplChain, typename TTypeView>
|
||||
void ZftIterTmplChainHead(TTypeView AO_View)
|
||||
*/
|
||||
template<typename TTmplChain, typename TTypeView>
|
||||
void ZftIterTmplChainTail(TTypeView AO_View)
|
||||
{
|
||||
AO_View.template OnMeetType<TTmplChain>();
|
||||
|
||||
if(TTmplChain::ZEBoolNext>0)
|
||||
{
|
||||
typedef typename
|
||||
TTmplChain::TypeChainNext TypeChainNext;
|
||||
|
||||
ZftIterTmplChainTail<TypeChainNext, TTypeView>(AO_View);
|
||||
}/*
|
||||
if(TTmplChain::ZEBoolNext>0)*/
|
||||
}/*
|
||||
template<typename TTmplChain, typename TTypeView>
|
||||
void ZftIterTmplChainTail(TTypeView AO_View)
|
||||
*/
|
||||
|
||||
|
||||
|
||||
namespace ZNsTmplChain
|
||||
{
|
||||
|
||||
@ -5764,9 +5885,9 @@ namespace ZNsMain
|
||||
/*++++++++++++++++++++++++++++++++++++++++++++++*/
|
||||
|
||||
template<> string & ZftMakeStr
|
||||
(string& ARR_SaveCStr, const ZtCChars<char , ZTypLength>& AR_View);
|
||||
(string& ARR_SaveCStr, const ZtCChars<char , ZTypLength>& AO_View);
|
||||
template<> wstring& ZftMakeStr
|
||||
(wstring& ARR_SaveCStr, const ZtCChars<wchar_t, ZTypLength>& AR_View);
|
||||
(wstring& ARR_SaveCStr, const ZtCChars<wchar_t, ZTypLength>& AO_View);
|
||||
|
||||
|
||||
|
||||
@ -9272,10 +9393,10 @@ namespace ZNsMain
|
||||
|
||||
|
||||
|
||||
template<> string& ZftMakeStr(string& ARR_SaveCStr, const ZCCharView& AR_View)
|
||||
{ ARR_SaveCStr.append(AR_View.data(), AR_View.size()); return ARR_SaveCStr; }
|
||||
template<> wstring& ZftMakeStr(wstring& ARR_SaveCStr, const ZCCharViewW& AR_View)
|
||||
{ ARR_SaveCStr.append(AR_View.data(), AR_View.size()); return ARR_SaveCStr; }
|
||||
template<> string& ZftMakeStr(string& ARR_SaveCStr, const ZCCharView& AO_View)
|
||||
{ ARR_SaveCStr.append(AO_View.data(), AO_View.size()); return ARR_SaveCStr; }
|
||||
template<> wstring& ZftMakeStr(wstring& ARR_SaveCStr, const ZCCharViewW& AO_View)
|
||||
{ ARR_SaveCStr.append(AO_View.data(), AO_View.size()); return ARR_SaveCStr; }
|
||||
|
||||
|
||||
/*//////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -9562,11 +9683,11 @@ namespace ZNsMain
|
||||
}/*
|
||||
ZCSngtLogData& operator()(const char* APC_LogData)*/
|
||||
|
||||
ZCSngtLogData& operator()(const ZCCharView& AR_View)
|
||||
ZCSngtLogData& operator()(const ZCCharView& AO_View)
|
||||
{
|
||||
ZCSngtLogData::Log(AR_View.data(), AR_View.size()); return *this;
|
||||
ZCSngtLogData::Log(AO_View.data(), AO_View.size()); return *this;
|
||||
}/*
|
||||
ZCSngtLogData& operator()(const ZCCharView& AR_View)*/
|
||||
ZCSngtLogData& operator()(const ZCCharView& AO_View)*/
|
||||
|
||||
ZCSngtLogData& operator()(int AI_LogData){ GetSngtView().Log(AI_LogData); return *this; }
|
||||
ZCSngtLogData& operator()(long AL_LogData){ GetSngtView().Log(AL_LogData); return *this; }
|
||||
|
Reference in New Issue
Block a user