Looking for someone's help me to make correct use of boost composite key.
Requirement:
Given config and type get all cid's
Below example I am passing config =1; and type = 1; I am expecting all cid's matching both of them. i.e 1 and 2 only
However if you see the out output it is: 1,2,3,1,8,3
//----------
#include
recordBookDef;
recordBookDef recordbook;
int main()
{
record obj1(1,1,1);
record obj2(2,2,1);
record obj3(3,3,1);
recordbook.insert(obj1);
recordbook.insert(obj2);
recordbook.insert(obj3);
record obj11(2,1,1);
record obj12(1,2,1);
record obj13(8,2,1);
recordbook.insert(obj11);
recordbook.insert(obj12);
recordbook.insert(obj13);
unsigned int config =1;
unsigned int type = 1;
recordBookDef::iterator it=recordbook.find(boost::make_tuple(config,type));
while(it!=recordbook.end())
{
//if(it->config == 1)
std::cout<<it->config<<",";
++it;
}
std::cout<