commit 2025-09-06 09:41 bug fix of ZftMakeTuple() in ZCppMain/ZMainHead.H

This commit is contained in:
2025-09-06 21:41:28 +09:00
parent 68c00e0569
commit 28b6010c51
2 changed files with 673 additions and 112 deletions

View File

@ -20,8 +20,40 @@ namespace ZNsMain
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
{
ZCStringStd VO_BuffCStr("myBuff");
ZTypInt VI_NowCnt = 0;
ZCStringStd VO_BuffCStr("myBuff") ;
ZTypInt VI_NowCnt = 0 ;
#ifdef __CPP_1998__
cout<<"# Use C++ 98 Spec"<<endl;
ZtStTuple<int>
myt1 = ZftMakeTuple(1);
ZtStTuple<int, int>
myt2 = ZftMakeTuple(1, 34);
ZtStTuple<int, int, char>
myt3 = ZftMakeTuple(1, 34, 'C');
ZtStTuple<int, int, char, ZCStringStd&>
myt4 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr));
ZtStTuple<int, int, char, ZCStringStd&, bool>
myt5 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true);
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*>
myt6 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB");
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double>
myt7 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34));
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float>
myt8 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43));
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&>
myt9 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr));
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&>
myt10= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt));
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&, int>
myt11= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), 20250906);
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&, int, wchar_t>
myt12= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), 20250906, wchar_t(0));
#else
cout<<"# Use auto keyword for ZtStTuple<> variable"<<endl;
auto myt1 = ZftMakeTuple(1);
auto myt2 = ZftMakeTuple(1, 34);
@ -35,6 +67,7 @@ namespace ZNsMain
auto myt10= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt));
auto myt11= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), 20250906);
auto myt12= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), 20250906, wchar_t(0));
#endif
myt10._10 = 1200;
myt11._10 += 1200;
@ -43,6 +76,19 @@ namespace ZNsMain
cout<<myt10._10<<endl;
cout<<VI_NowCnt<<endl;
cout<<"_1 type : "<<typeid(myt12._1 ).name()<<endl;
cout<<"_2 type : "<<typeid(myt12._2 ).name()<<endl;
cout<<"_3 type : "<<typeid(myt12._3 ).name()<<endl;
cout<<"_4 type : "<<typeid(myt12._4 ).name()<<endl;
cout<<"_5 type : "<<typeid(myt12._5 ).name()<<endl;
cout<<"_6 type : "<<typeid(myt12._6 ).name()<<endl;
cout<<"_7 type : "<<typeid(myt12._7 ).name()<<endl;
cout<<"_8 type : "<<typeid(myt12._8 ).name()<<endl;
cout<<"_9 type : "<<typeid(myt12._9 ).name()<<endl;
cout<<"_10 type : "<<typeid(myt12._10).name()<<endl;
cout<<"_11 type : "<<typeid(myt12._11).name()<<endl;
cout<<"_12 type : "<<typeid(myt12._12).name()<<endl;
return 0;
}/*
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
@ -77,8 +123,8 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
■ mingw 컴파일
//g++.exe -std=c++98 -o ZftMakeTuple_000_mw.exe ZftMakeTuple_000.cpp -I../
//g++.exe -std=c++98 -o ZftMakeTuple_000_mw_D.exe ZftMakeTuple_000.cpp -I../ -D_DEBUG
g++.exe -std=c++98 -o ZftMakeTuple_000_mw_98.exe ZftMakeTuple_000.cpp -I../ -D__CPP_1998__
g++.exe -std=c++98 -o ZftMakeTuple_000_mw_98_D.exe ZftMakeTuple_000.cpp -I../ -D__CPP_1998__ -D_DEBUG
g++.exe -o ZftMakeTuple_000_mw.exe ZftMakeTuple_000.cpp -I../
g++.exe -o ZftMakeTuple_000_mw_D.exe ZftMakeTuple_000.cpp -I../ -D_DEBUG
@ -86,6 +132,9 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
./ZftMakeTuple_000_mw.exe
./ZftMakeTuple_000_mw_D.exe
./ZftMakeTuple_000_mw_98.exe
./ZftMakeTuple_000_mw_98_D.exe
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
# date
@ -107,6 +156,9 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
g++ -o ZftMakeTuple_000.exe ZftMakeTuple_000.cpp -I../
g++ -o ZftMakeTuple_000_D.exe ZftMakeTuple_000.cpp -I../ -D_DEBUG
g++ -o ZftMakeTuple_000_98.exe ZftMakeTuple_000.cpp -I../ -D__CPP_1998__
g++ -o ZftMakeTuple_000_98_D.exe ZftMakeTuple_000.cpp -I../ -D__CPP_1998__ -D_DEBUG
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
@ -145,4 +197,7 @@ int main(int AI_ArgCnt, char* APP_ArgVal[])*/
./ZftMakeTuple_000.exe
./ZftMakeTuple_000_D.exe
./ZftMakeTuple_000_98.exe
./ZftMakeTuple_000_98_D.exe
////////////////////////////////////////////////////////////////////////////////////////*/