Opened 8 years ago
Last modified 8 years ago
#10370 new Bugs
Iterating over ptr_map type is largely broken in 1.56
Reported by: | Owned by: | Thorsten Ottosen | |
---|---|---|---|
Milestone: | To Be Determined | Component: | ptr_container |
Version: | Boost 1.56.0 | Severity: | Showstopper |
Keywords: | ptr_map | Cc: |
Description
Iteration over map fails on most types, except for value. Not sure which version this failure began, but definitely present in 1.56
The following simple snippet will fail:
typedef boost::ptr_map<int, int> test_map_type; test_map_type test_map;
BOOST_FOREACH(test_map_type::const_reference r, test_vector ) {
}
Will also fail with reference, iterator, const_iterator. boost::tie also fails. Can iterate by value, but this does not help with my application since the mapped type will be an abstract type (so no clone allocator for mapped type)
Change History (3)
comment:1 by , 8 years ago
Component: | foreach → ptr_container |
---|---|
Keywords: | foreach removed |
Owner: | changed from | to
comment:2 by , 8 years ago
Discovered that switching compiler flag to c++11 resolved the problem. Maybe this problem is specific to GNU compiler without c++11 enabled?
This test case shows the problem is specific to ptr_container and has nothing to do with
BOOST_FOREACH
.For me, this gives: