
3 Feb
2010
3 Feb
'10
2:49 p.m.
struct employee { employee(int id):id(id){} int id; };
Further I have to check if every id is unique:
employee* e0 = new employee(1); employee* e1 = e0; employee* e2 = new employee(1); employee* e3 = new employee(2);
my_multi_index_conatiner.insert(e0); // OK my_multi_index_conatiner.insert(e1); // BAD my_multi_index_conatiner.insert(e2); // BAD my_multi_index_conatiner.insert(e0); // OK
Can someone tell me how a typedef of a multi_index_container fullfilling prerequisities above looks?
typedef mi::multi_index_container<
employee *,
mi::indexed_by<
mi::ordered_unique
employee_set;