|
Boost Users : |
Subject: [Boost-users] boost multi_index_container with composite_key iterator
From: Uthpal Urubail (uthpal.urubail_at_[hidden])
Date: 2015-06-04 05:21:47
Experts,
Is there a better approach to iterator over boost multiindex composite key?
The issue with the below approach is, the same key is appearing multiple times.
typedef multi_index_container loadTable_Def;
loadTable_Def pb;
//!
for(loadTable_Def::iterator i=pb.begin(),i_end=pb.end();i!=i_end; )
{
// Get the range of the current key
loadTable_Def::iterator iter_next=pb.upper_bound(pb.key_extractor()(*i));
do
{
loadTable_Def::iterator it1,it2;
boost::tie(it1,it2) = pb.equal_range(boost::make_tuple(<passing multiple key >));
while(it1 != it2)
{
//std::cout<<"print values"<<" ,";
++it1;
}
}
while(++i!=iter_next);
}
Regards,
UJ
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net