On Thu, Mar 3, 2016 at 2:06 PM, Joaquin M LópezMuñoz
Dominique Devienne
writes: On Thu, Mar 3, 2016 at 10:21 AM, Joaquin M LópezMuñoz
[...]
struct entry { int uid; // real uuid in reality, but enough for our needs here int occurence; // the field to be indexed, uniquely "except for -1" };
OK, yes, we can do something with that. What you want is unique sorting by occurrence, except when occurrence==-1 in which case you want to (uniquely) sort lexicographically on uid. This *is* indeed a SWO, [...]
Thank you for confirming what I suspected. [...] Thanks to the overloads of entry_occurrence_less::operator()
we can lookup by occurrence as if we were using member
:
This is the part I was missing, and struggling with. Seems simple, in hindsight :)
I think this suits exactly your needs, please report back otherwise.
Thank you so much for your help Joaquin. (and for BMI of course! My favorite container!!!) This is exactly what I was looking for. Encore merci, --DD