
That's right, but did you consider what I commented in my previous post?
Yeah, I did but the variable id is coming from outside (user) and not from inside (software). So p->id is never used. The user can enter any kind of id (e.g. non-existend id) and with this id the object is found (or not found) and edited (by the user). The software uses pointer to find the variable if something inside changes. E.g. a member inside a object changes (by usage of a pointer outside the object). This member will notify all objects where it is a member (via pointer). But I have again a problem. I can't get the member variable (like id in this example) directly. I have to use get_id(). When defining: typedef multi_index_container < employee*, indexed_by < ordered_unique<identity<employee*> >, // next line does not work ordered_unique<member<employee, int, &employee::get_id()> >
employee_set;
The code does not compile: error: ‘Employee::get_id() const’ cannot appear in a constant-expression error: a function call cannot appear in a constant-expression How can I fix it?