[Boost-bugs] [Boost C++ Libraries] #4544: shared_ptr seems to be mistake in unordered_set

Subject: [Boost-bugs] [Boost C++ Libraries] #4544: shared_ptr seems to be mistake in unordered_set
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-16 16:11:47


#4544: shared_ptr seems to be mistake in unordered_set
-------------------------------------------+--------------------------------
 Reporter: showern <showern@…> | Owner:
     Type: Bugs | Status: new
Milestone: Boost.Jam 4.0.0 | Component: None
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
-------------------------------------------+--------------------------------
 class Abc
 {
 };

 int main()
 {
     boost::shared_ptr a(new Abc);
     boost::shared_ptr b(new Abc);
     unordered_set<shared_ptr<Abc> > xx;
     xx.insert(a);
     xx.insert(b);

     // always get 1 here,
     cout << xx.hash_function()(a) << " " << xx.hash_function()
     << endl;

     return 0;
 }

 judging two objects pointed by shared_ptr should compare the address of
 them, but how hash_function() always returns 1?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4544>
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