Re: [Boost-bugs] [Boost C++ Libraries] #12542: multi_index constraint violation if rollback callable is passed, but doesn't correct the issue

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12542: multi_index constraint violation if rollback callable is passed, but doesn't correct the issue
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-10-22 08:26:19


#12542: multi_index constraint violation if rollback callable is passed, but
doesn't correct the issue
-----------------------------------+-------------------------
  Reporter: Jon Kalb <jonkalb@…> | Owner: joaquin
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: multi_index
   Version: Boost 1.61.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+-------------------------

Comment (by joaquin):

 Hi Jon,

 The behavior is in conformance with the reference:

 "'''Requires:''' [...] The sequence of operations `mod(e)`, `back(e)`
 restores all keys of the element to their original state."

 So, if the user-provided rollback fails to restore keys, it is a violation
 of requirements on the user's side, not the lib's fault. Note that the
 rollback function has the option to throw if, for some reason, it can't
 restore the keys:

 "'''Exception safety:''' Strong, except if `back` throws an exception, in
 which case the modified element is erased [...]"

 Another issue is whether the documented behavior should be changed so that
 the library re-checks invariants after `back` is executed. My personal
 opinion is that it shouldn't, as we would be imposing an uncalled for
 overhead on the users who provide a conforming rollback function. Also,
 the user has the option to set the
 [http://www.boost.org/libs/multi_index/doc/tutorial/debug.html#invariant_check
 invariant-checking mode], which detects and signals this situation.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12542#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC