help boost multi_index_container + composite key
All,
I am experimenting boost for some specific requirement.
The following code fails to retrieve the values. Could any one of you
help me find out my mistake with the below code?
#include
elementbook;
int main()
{
elementbook pb;
Elem_entry fc1 = Elem_entry(1,1,2);
pb.insert(fc1);
Elem_entry fc2 = Elem_entry(2,2,3);
pb.insert(fc2);
Elem_entry fc3 = Elem_entry(3,3,1);
pb.insert(fc3);
int faceId = 0;
elementbook::iterator it;
//Below code not working
it = pb.find(boost::make_tuple(2,3));
if(it != pb.end())
{
faceId = it->faceid;
bool valid = true;
valid = false;
}
for (elementbook::iterator iter = pb.begin(), i_end = pb.end(); iter
!= i_end;
iter = pb.upper_bound(iter->faceid))
{
std::cout<<iter->faceid<<"\t"<<iter->node1<<"\t"<<iter->node2<
participants (2)
-
Igor R
-
Uthpal Urubail