typedef std::pair< string, string > sw_key;
typedef std::vector< sw_key > sw_keys;
sw_key swkey;
sw_keys vecSWKeys;
std::back_insert_iterator<sw_keys> it(vecSWKeys);
//读取sw_key并将其保存在vecSWKeys向量
中pCPxml->FindAttrText( "/cpq_package/sw_keys/sw_keys_and/sw_key", "name", it);
for (deviceData=pXML->GetFirstChild(device); deviceData!=0; deviceData=pXML->GetFollowingSibling(deviceData) )
{
string sVal;
pXML->FindFirstText( deviceData, &sVal );
switch(count)
{
case 3:
//在这一行中我想将sVal分配给矢量中对的值,但是它失败了
vecSWKeys[count].second=sVal;
break;
}
count++;
}