|
Boost Users : |
Subject: [Boost-users] [intrusive] insert_check and insert_commit
From: Paul Rose (paul.d.rose_at_[hidden])
Date: 2011-02-07 18:26:43
Hi,
I have a question regarding insert_check and insert_commit on an intrusive
set.
I know that you must call insert_commit after calling insert_check, with no
modifications to the set between the two calls.
Is it OK, however, to call insert_check and then never call insert_commit
(even though insert_check was successful)?
Say I have objects contained in multiple sets (using multiple hooks). I
want to insert a new object into each of the sets, but only if I know that
the insert will succeed on all of the sets. I call insert_check on each,
and if all succeed I call insert_commit on each. If any of the insert_check
calls fail, I do none of the insert_commits (even though all but one might
have worked)
It seems like it should be OK, and the documentation doesn't say that it
won't work. I'm only concerned for two related reasons:
1) insert_check is not declared const. Does this mean that the set is
already partially modified?
2) insert_commit is documented as constant time. Does this mean that any
red-black rebalancing was already done during insert_check? If so, what
happens if I never do the insert_commit?
Thanks!
Paul Rose
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