Boost logo

Boost Users :

Subject: Re: [Boost-users] [mutli_index] class reference available? / How to detect insertion failures
From: Adam Merz (adammerz_at_[hidden])
Date: 2008-10-09 18:50:46


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.html

Insert behavior is documented here:
http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/reference/ord_indices.html#modifiers

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."


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net