Files
RepoMain/ZCppMainTest/ZftMakeTuple_000.cpp

220 lines
10 KiB
C++

#include <iostream>
#include "ZCppMain/ZCStringStd.H"
using namespace std ;
using namespace ZNsMain;
namespace ZNsMain
{
namespace ZNsExam
{
template<typename TDummy=void*> class ZtCExamTuple_000
{
public:
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)
{
ZCStringStd VO_BuffCStr("myBuff") ;
ZTypInt VI_NowCnt = 0 ;
cout<<"# __cplusplus : "<<__cplusplus<<endl;
#if defined(__CPLUSPLUS_VER__) && __CPLUSPLUS_VER__<=199800
cout<<"# Use C++ 98 Spec"<<endl;
ZtStTuple<>
myt0 = ZftMakeTuple();
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&, long>
myt11= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906);
ZtStTuple<int, int, char, ZCStringStd&, bool, const char*, double, float, ZCStringStd&, int&, long, wchar_t>
myt12= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906, wchar_t(0));
#else
cout<<"# Use auto keyword for ZtStTuple<> variable"<<endl;
auto myt0 = ZftMakeTuple();
auto myt1 = ZftMakeTuple(1);
auto myt2 = ZftMakeTuple(1, 34);
auto myt3 = ZftMakeTuple(1, 34, 'C');
auto myt4 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr));
auto myt5 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true);
auto myt6 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB");
auto myt7 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34));
auto myt8 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43));
auto myt9 = ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr));
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), (long)20250906);
auto myt12= ZftMakeTuple(1, 34, 'C', ZftMCP(VO_BuffCStr), true, "AB", double(0.34), float(24.43), ZftMCP(VO_BuffCStr), ZftMCP(VI_NowCnt), (long)20250906, wchar_t(0));
#endif
myt10._10 = 1200;
myt11._10 += 1200;
// 아래 2개 출력이 같아야 한다.
cout<<myt10._10<<endl;
cout<<VI_NowCnt<<endl;
cout<<"_1 type : "<<typeid(myt12._1 ).name()<<endl;
cout<<" value: "<< myt12._1 <<endl;
cout<<"_2 type : "<<typeid(myt12._2 ).name()<<endl;
cout<<" value: "<< myt12._2 <<endl;
cout<<"_3 type : "<<typeid(myt12._3 ).name()<<endl;
cout<<" value: "<< myt12._3 <<endl;
cout<<"_4 type : "<<typeid(myt12._4 ).name()<<endl;
cout<<" value: "<< myt12._4 <<endl;
cout<<"_5 type : "<<typeid(myt12._5 ).name()<<endl;
cout<<" value: "<< myt12._5 <<endl;
cout<<"_6 type : "<<typeid(myt12._6 ).name()<<endl;
cout<<" value: "<< myt12._6 <<endl;
cout<<"_7 type : "<<typeid(myt12._7 ).name()<<endl;
cout<<" value: "<< myt12._7 <<endl;
cout<<"_8 type : "<<typeid(myt12._8 ).name()<<endl;
cout<<" value: "<< myt12._8 <<endl;
cout<<"_9 type : "<<typeid(myt12._9 ).name()<<endl;
cout<<" value: "<< myt12._9 <<endl;
cout<<"_10 type : "<<typeid(myt12._10).name()<<endl;
cout<<" value: "<< myt12._10 <<endl;
cout<<"_11 type : "<<typeid(myt12._11).name()<<endl;
cout<<" value: "<< myt12._11 <<endl;
cout<<"_12 type : "<<typeid(myt12._12).name()<<endl;
cout<<" value: "<< myt12._12 <<endl;
return 0;
}/*
static int Main(int AI_ArgCnt=0, char* APP_ArgVal[]=0)*/
public:
};/*
template<typename TDummy=void*> class ZtCExamTuple_000*/
}/*
namespace ZNsExam*/
}/*
namespace ZNsMain*/
int main(int AI_ArgCnt, char* APP_ArgVal[])
{
return ZNsMain::ZNsExam::
ZtCExamTuple_000<>::Main(AI_ArgCnt, APP_ArgVal);
}/*
int main(int AI_ArgCnt, char* APP_ArgVal[])*/
/*////////////////////////////////////////////////////////////////////////////////////////
■ cygwin 컴파일
// g++ -mno-cygwin -o ZftMakeTuple_000.exe ZftMakeTuple_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300
// g++ -mno-cygwin -o ZftMakeTuple_000_D.exe ZftMakeTuple_000.cpp -I../../my_CPP/CPP_Main/ -I../../my_CPP/CPP_Std/ -D__CYGWIN32__ -D__VISUAL_CPP_VER__=200300 -D_DEBUG
■ mingw 컴파일
g++.exe -std=c++98 -o ZftMakeTuple_000_mw_98.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800
g++.exe -std=c++98 -o ZftMakeTuple_000_mw_98_D.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800 -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
./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
Sun Aug 24 10:47:09 KST 2025
Administrator@q381-2673 UCRT64 /e/my_CPP/ZCpp/ZCppMainTest
# g++ --version
g++.exe (Rev2, Built by MSYS2 project) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
■ Linux 컴파일
//g++ -std=c++98 -o ZftMakeTuple_000.exe ZftMakeTuple_000.cpp -I../ -lpthread
//g++ -std=c++98 -o ZftMakeTuple_000_D.exe ZftMakeTuple_000.cpp -I../ -lpthread -D_DEBUG
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__CPLUSPLUS_VER__=199800
g++ -o ZftMakeTuple_000_98_D.exe ZftMakeTuple_000.cpp -I../ -D__CPLUSPLUS_VER__=199800 -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.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ date
Sun Aug 24 00:05:51 DST 2025
sauron@q381-2673:/mnt/e/my_CPP/ZCpp/ZCppMainTest$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
[sauron@q381-2657 ZCppMainTest]$ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[sauron@q381-2657 ZCppMainTest]$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
■ 실행
./ZftMakeTuple_000.exe
./ZftMakeTuple_000_D.exe
./ZftMakeTuple_000_98.exe
./ZftMakeTuple_000_98_D.exe
////////////////////////////////////////////////////////////////////////////////////////*/