diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index d789f06..5e31ed3 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -721,10 +721,11 @@ namespace ZNsMain namespace ZNsEnum*/ - template int GetCompareCode( + template ZTypIntE GetCompareCode + ( const TTypeChar* ApcLeft , TTypeLength AI_LeftLength , const TTypeChar* ApcRight, TTypeLength AI_RightLength - ) /*################################################################*/ + ) /*####################################################################*/ { if(AI_LeftLength<1 && AI_RightLength<1) return ZNsEnum::ZECompareResult_Equal; @@ -743,10 +744,11 @@ namespace ZNsMain return ZNsEnum::ZECompareResult_Equal; }/* - template int GetCompareCode( + template ZTypIntE GetCompareCode + ( const TTypeChar* ApcLeft , TTypeLength AI_LeftLength, const TTypeChar* ApcRight, TTypeLength AI_RightLength - ) ##################################################################*/ + ) ######################################################################*/ namespace ZNsType @@ -975,6 +977,59 @@ namespace ZNsMain namespace ZNsType*/ + /* 어떤 변수를 강제적으로 참조로 인식하게 하는 클래스. 인수를 참조로 + 넘어가게 하고 싶을 때 사용한다. class ZtCCheckRef 에서 사용하고 있다. + -- 2021-04-10 16:15 + */ + template class ZtCRef + { + public : + typedef TType& TypeData; + typedef TType TypeRaw ; + private: + TypeData mr_Data; + public : + ZtCRef(TypeData AR_TypeData) : mr_Data(AR_TypeData){} + public : + TypeData GetData(){return mr_Data;} + };/* + template class ZtCRef*/ + + + /* template 인수에 ZtCRef 가 있으면, 해당 값을 참조로 인식하고 + 그렇지 않으면, 일반적인 복사해서 전달되는 값으로 인식한다. + -- 2021-04-10 16:15 + */ + template class ZtCCheckRef + { + public : + typedef TType TypeData ; + typedef TType TypeRaw ; + private: + TypeData mr_Data; + public : + ZtCCheckRef(TypeData AR_TypeData) : mr_Data(AR_TypeData){} + public : + TypeData GetData(){return mr_Data;} + };/* + template class ZtCCheckRef*/ + + /* ZtCRef 전문화 */ + template class ZtCCheckRef< ZtCRef > + { + public : + typedef TType& TypeData; + typedef TType TypeRaw ; + private: + TypeData mr_Data; + public : + ZtCCheckRef(TypeData AR_TypeData) : mr_Data(AR_TypeData){} + public : + TypeData GetData(){return mr_Data;} + };/* + template class ZtCCheckRef< ZtCRef >*/ + + template class ZtCArguBind { public: diff --git a/ZCppMain/test.cpp b/ZCppMain/test.cpp index e1902f3..968e471 100644 --- a/ZCppMain/test.cpp +++ b/ZCppMain/test.cpp @@ -85,6 +85,15 @@ int main(int ArgiCnt, char** AppArgu) HereInt2 myi2= &myi1; HereInt3 myi3= myi1 ; myi3=123; + ZtCRef myref(myi1); + ZtCCheckRef< int > myrefcheck1(myi1); myrefcheck1.GetData(); + ZtCCheckRef< ZtCRef > myrefcheck2(myi1); myrefcheck2.GetData(); + + myi1=4321; + + cout<<"# myrefcheck1.GetData()="<