Boost logo

Boost Users :

Subject: Re: [Boost-users] boost multi_index_container with composite_key iterator
From: Ernest Zaslavsky (ernest.zaslavsky_at_[hidden])
Date: 2015-06-04 05:27:59


And what is the problem with the same key appearing more than once in case the index is (ordered/hashed)_non_unique index?

From: Boost-users [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Uthpal Urubail
Sent: Thursday, June 04, 2015 12:22 PM
To: boost-users_at_[hidden]
Subject: [Boost-users] boost multi_index_container with composite_key iterator

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

[Read More]<http://feeds.feedburner.com/~r/sizmek-blog/~6/1>

[http://www.sizmek.com/Sizmek.png]<http://www.sizmek.com/>



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