2021-02-25 17:51:25 +09:00
|
|
|
|
2021-02-26 17:21:25 +09:00
|
|
|
|
2021-02-25 17:52:07 +09:00
|
|
|
#include <iostream>
|
2021-02-26 17:21:25 +09:00
|
|
|
#include "ZtCObjList.H"
|
2021-02-25 17:27:36 +09:00
|
|
|
|
2021-02-25 17:51:25 +09:00
|
|
|
|
2021-02-26 17:33:59 +09:00
|
|
|
using namespace std ;
|
|
|
|
using namespace ZNsMain ;
|
2021-02-25 17:27:36 +09:00
|
|
|
|
2021-02-25 17:51:25 +09:00
|
|
|
|
2021-02-26 17:58:57 +09:00
|
|
|
namespace ZNsMain{namespace ZNsHide
|
2021-02-26 17:57:28 +09:00
|
|
|
{
|
|
|
|
|
|
|
|
class ZCFunctor1
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
ZTypInt mi_Index;
|
|
|
|
public :
|
|
|
|
|
|
|
|
ZCFunctor1(){mi_Index=0;}
|
|
|
|
|
|
|
|
void operator()(int ArgiValue)
|
|
|
|
{ cout<<"# index="<<++mi_Index<<", Value="<<ArgiValue<<endl; }
|
|
|
|
public :
|
|
|
|
};/*
|
|
|
|
class ZCFunctor1*/
|
|
|
|
|
|
|
|
}/*
|
2021-02-26 17:58:57 +09:00
|
|
|
namespace ZNsHide}namespace ZNsMain*/
|
2021-02-26 17:57:28 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-26 17:33:59 +09:00
|
|
|
int main(int ArgiCnt, char** AppArgu)
|
|
|
|
{
|
2021-02-26 17:36:05 +09:00
|
|
|
cout<<endl<<"!!! C++'s Great Start !!!"<<endl<<endl;
|
2021-02-25 17:27:36 +09:00
|
|
|
|
2021-02-26 17:33:59 +09:00
|
|
|
|
|
|
|
typedef ZNsMain::ZtCObjList<int> CListByInt;
|
|
|
|
|
|
|
|
CListByInt VO_IntList;
|
|
|
|
|
2021-02-26 17:34:33 +09:00
|
|
|
VO_IntList.AddTail(1);
|
|
|
|
VO_IntList.AddTail(4);
|
|
|
|
VO_IntList.AddTail(2);
|
|
|
|
VO_IntList.AddTail(8);
|
|
|
|
VO_IntList.AddTail(9);
|
2021-02-26 17:33:59 +09:00
|
|
|
|
2021-02-26 17:41:18 +09:00
|
|
|
|
2021-02-26 17:55:33 +09:00
|
|
|
_FFS_(ZCShowData)
|
2021-02-26 17:41:18 +09:00
|
|
|
(ZTypInt AiInt)
|
|
|
|
{
|
2021-02-26 17:55:33 +09:00
|
|
|
cout<<"# Elem : "<< AiInt << endl;
|
|
|
|
}/*
|
|
|
|
(ZTypInt AiInt)*/
|
2021-02-26 17:41:18 +09:00
|
|
|
_FFC_(My3)
|
|
|
|
|
|
|
|
|
2021-02-26 17:55:33 +09:00
|
|
|
|
2021-02-26 17:57:28 +09:00
|
|
|
ZNsHide::ZCFunctor1 VO_CFunctor1;
|
2021-02-26 17:55:33 +09:00
|
|
|
|
|
|
|
VO_IntList.IterElement(ZCShowData::Exec);
|
|
|
|
VO_IntList.IterElement(&VO_CFunctor1 );
|
2021-02-26 17:33:59 +09:00
|
|
|
|
2021-02-25 17:51:25 +09:00
|
|
|
return 0;
|
|
|
|
}/*
|
|
|
|
int main(int ArgiCnt, char** AppArgu)*/
|
2021-02-26 17:33:59 +09:00
|
|
|
|
|
|
|
|
|
|
|
/*/////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
■ 컴파일
|
|
|
|
|
|
|
|
g++ -o test.exe test.cpp -I..
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////*/
|