Subject: [Boost-bugs] [Boost C++ Libraries] #6237: unordered_set behaves differently from 1.46 to 1.48
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-07 23:49:36
#6237: unordered_set behaves differently from 1.46 to 1.48
------------------------------------------------------+---------------------
Reporter: Chris Meyer <cmeyer1969+boost@â¦> | Owner: danieljames
Type: Bugs | Status: new
Milestone: To Be Determined | Component: unordered
Version: Boost 1.48.0 | Severity: Regression
Keywords: |
------------------------------------------------------+---------------------
The following code runs OK on 1.46 but fails on 1.48. The correct output
is "1".
{{{
// gcc -Iboost -lstdc++ test1.cpp
#include <iostream>
#include <boost/smart_ptr.hpp>
#include <boost/unordered_set.hpp>
namespace ns {
typedef boost::shared_ptr<class c> cptr;
typedef boost::unordered_set<cptr> cset;
class c
{
public:
c() { }
};
bool operator==(const cptr &c1, const cptr &c2) { return true; }
}
int main(int argc, char **argv)
{
ns::cptr bb1(new ns::c());
ns::cptr bb2(new ns::c());
ns::cset cs;
cs.insert(boost::dynamic_pointer_cast<ns::c>(bb1));
cs.insert(boost::dynamic_pointer_cast<ns::c>(bb1));
cs.insert(boost::dynamic_pointer_cast<ns::c>(bb2));
cs.insert(boost::dynamic_pointer_cast<ns::c>(bb2));
std::cout << "This should be 1: " << cs.size() << std::endl;
}
}}}
I'm using Xcode 4.2 / gcc on 10.6.8.
i686-apple-darwin10-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build
5658) (LLVM build 2336.1.00)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6237> 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:08 UTC