Re: [Boost-bugs] [Boost C++ Libraries] #2393: ptr_map_adapter::insert uses non-const key parameter

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2393: ptr_map_adapter::insert uses non-const key parameter
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-23 13:04:05


#2393: ptr_map_adapter::insert uses non-const key parameter
---------------------------+------------------------------------------------
  Reporter: anonymous | Owner: nesotto
      Type: Patches | Status: reopened
 Milestone: Boost 1.44.0 | Component: ptr_container
   Version: Boost 1.43.0 | Severity: Problem
Resolution: | Keywords:
---------------------------+------------------------------------------------

Comment (by anonymous):

 A. The key is not modified.
 B. The exception-safety we get by a non-const reference is not total, but
 probably better than nothing (if the expression returns an lvalue, then
 the expression might throw).'
 C. One could make the parameter const for types that do not throw upon
 copy,but it still leaves the hole when the expression throws. Here we must
 trust the programmer until a better solution arives.
 D. An lvalue often forces the programmer to store the object in a local
 variable, thus increasin exception-safety in the sense that the expression
 involving the key cannot throw.

 -Thorsten

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2393#comment:3>
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:04 UTC