
Nick Martin writes:
There doesn't appear to be comprehensive class reference documentation. I only figured out how to do simple tasks like inserting new items into the container by looking at the examples (http://www.boost.org/doc/libs/1_36_0/libs/multi_index/example/basic.cpp).
My specific question (which the examples don't seem to cover) is how to tell when insertion fails. What if the new item's unique key constraint fails? I have had many other, seemingly simple questions that I would hope could be answered in minutes or seconds that have turned into hours of trial and error and combing through example programs. What other resources are out there that I refer to in order to use this great library?
Full reference documentation is here: http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/reference/index.ht... Insert behavior is documented here: http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/reference/ord_indi... In answer to your specific question, "The return value is a pair p. p.second is true if and only if insertion took place. On successful insertion, p.first points to the element inserted; otherwise, p.first points to an element that caused the insertion to be banned. Note that more than one element can be causing insertion not to be allowed."