Re: [Boost-bugs] [Boost C++ Libraries] #9668: insert_check and callees should pass KeyValueCompare by const reference

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9668: insert_check and callees should pass KeyValueCompare by const reference
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-15 17:16:02


#9668: insert_check and callees should pass KeyValueCompare by const reference
-------------------------------+--------------------------
  Reporter: vinnie.falco@… | Owner: igaztanaga
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: intrusive
   Version: Boost 1.55.0 | Severity: Optimization
Resolution: invalid | Keywords:
-------------------------------+--------------------------

Comment (by vinnie.falco@…):

 That's a fair point, and one that I hadn't considered. Changing my calls
 to insert_commit to use std::ref() for the functor solved the problem.

 The reason that I brought it up is because there is a certain asymmetry in
 the API. When you construct a container with a custom Compare object and
 initialize it in the constructor, it because a data member of the
 container and is never copied when used in functions like the find()
 overloads which do not take an additional KeyValueCompare parameter.
 Compare this with the signatures of the overloads which do take the
 KeyValueCompare by value.

 However, this asymmetry is the lesser of the evils, especially since the
 reference wrapper is a very acceptible workaround. Thanks

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9668#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:15 UTC