I have the following code (which largely follows the first example here: http://www.boost.org/doc/libs/1_42_0/libs/multi_index/doc/examples.html)). For some reason, with only 10000 insertations to the multi-index, it takes several minutes to run the program. Am I doing something wrong or is this expected?
struct A
{
int id;
int name;
int age;
A(int id_,int name_,int age_):id(id_),name(name_),age(age_){}
};
/* tags for accessing the corresponding indices*/
struct id{};
struct name{};
struct age{};
typedef multi_index_container<
A,
indexed_by<
ordered_unique<
tag<id>, BOOST_MULTI_INDEX_MEMBER(A,int,id)>,
ordered_non_unique<
tag<name>,BOOST_MULTI_INDEX_MEMBER(A,int,name)>,
ordered_non_unique<
tag<age>, BOOST_MULTI_INDEX_MEMBER(A,int,age)> >
> A_set;
int main()
{
A_set es;
for (int a = 0; a != 10000; a++) {
es.insert(A(a,a+1,a+2));
}
return 0;
}