#include <iostream>
#include <vector>
using namespace std;
typedef struct _AppsData
{
_AppsData(const _AppsData &) = default;
_AppsData() = default;
void clear() {
cout << "AppsData clear" << endl;
appId = "String APP ID";
}
int operator == (struct _AppsData & appData) {
std::string tagAppId;
tagAppId = appData.appId;
cout << "_AppsData operator == appData:" << tagAppId << endl;
return 0;
}
struct _AppsData & operator = (struct _AppsData & appData) {
cout << "_AppsData operator=" << endl;
appId = appData.appId;
return *this;
}
std::string appId;
} AppsData;
typedef struct _APPInfo
{
std::string strAppCRID;
}APPInfo, *PAPPInfo;
int test1(const std::string appid)
{
std::vector<AppsData>::iterator cc;
if(appid.size() == 0) {
cout << "appid size = 0" << endl;
}
return 0;
}
int main()
{
bool b = false;
PAPPInfo pAppInfo;
AppsData appData;
cout << "Start main" << endl;
appData.clear();
cout << "Do pAppInfo->strAppCRID appData.appId:" << appData.appId << endl;
pAppInfo->strAppCRID = appData.appId;
cout << "Start test1" << endl;
b = !(bool)test1(std::string(pAppInfo->strAppCRID));
cout << "end b" << b;
return 0;
}
No comments:
Post a Comment