Re: [Boost-bugs] [Boost C++ Libraries] #6711: with unordered_map using interprocess basic_string in shared memory, find and [] are annoying

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6711: with unordered_map using interprocess basic_string in shared memory, find and [] are annoying
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-23 12:58:08


#6711: with unordered_map using interprocess basic_string in shared memory, find
and [] are annoying
----------------------------------+-----------------------------------------
  Reporter: jdy@… | Owner:
      Type: Feature Requests | Status: closed
 Milestone: To Be Determined | Component: None
   Version: Boost 1.49.0 | Severity: Problem
Resolution: wontfix | Keywords: interprocess, unordered_map, container
----------------------------------+-----------------------------------------

Comment (by anonymous):

 Sorry, I messed up that example, here's a better one. This one doesn't use
 rvalue references because I don't have access to an appropriate compiler
 at the moment, but it demonstrates why a template method would break valid
 code (`foo` calls `std::equal_to` in the same way that `find` does):

 {{{
 #include <functional>

 struct source {};

 struct value {
     value(source&) {}
     bool operator==(value const&) const { return true; }
 };

 struct pseudo_container
 {
     std::equal_to<value> eq;

 #if defined(USE_A_TEMPLATE)
     template <typename T>
     void foo(T const& x) {
         eq(x, x);
     }
 #else
     void foo(value const& x) {
         eq(x, x);
     }
 #endif
 };

 int main() {
     pseudo_container x;
     source s;
     x.foo(s);
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6711#comment:5>
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:09 UTC