Try to definitely fix Trac Issue #9931 (flat_map::insert(ordered_unique_range_t...) fails with move_iterators")

This commit is contained in:
Ion Gaztañaga
2015-02-03 16:09:47 +01:00
parent 5455eb58bf
commit f47bf08ccc
2 changed files with 7 additions and 2 deletions

View File

@@ -1089,13 +1089,14 @@ use [*Boost.Container]? There are several reasons for that:
* Updated containers to implement new constructors as specified in * Updated containers to implement new constructors as specified in
[@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2210 2210. Missing allocator-extended constructor for allocator-aware containers]. [@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2210 2210. Missing allocator-extended constructor for allocator-aware containers].
* Fixed bugs: * Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/9931 #9931: ['"flat_map::insert(ordered_unique_range_t...) fails with move_iterators"]] (reopened).
* [@https://svn.boost.org/trac/boost/ticket/10790 Trac #10790 (['long long errors from container"])]. * [@https://svn.boost.org/trac/boost/ticket/10790 Trac #10790 (['long long errors from container"])].
* [@https://svn.boost.org/trac/boost/ticket/10808 Trac #10808 (['compare equal operator of vector is broken"])]. * [@https://svn.boost.org/trac/boost/ticket/10808 Trac #10808 (['compare equal operator of vector is broken"])].
* [*Source Breaking]: [classref boost::container::scoped_allocator_adaptor scoped_allocator_adaptor]'s * [*Source Breaking]: [classref boost::container::scoped_allocator_adaptor scoped_allocator_adaptor]'s
`propagate_on_container_copy_assignment`, `propagate_on_container_move_assignment` and `propagate_on_container_swap` `propagate_on_container_copy_assignment`, `propagate_on_container_move_assignment` and `propagate_on_container_swap`
are no longer `::boost::integral_constant<bool, true/false>` types. The dependency reorganization needed to break are no longer `::boost::integral_constant<bool, true/false>` types. The dependency reorganization needed to break
with those classes to avoid MPL dependencies, and interoperability with `std::integral_constant` was not guaranteed. with those classes to avoid MPL dependencies, and interoperability with `std::integral_constant` was not guaranteed.
Code assumming `boost::true_type/boost::false_type` on this will not compile. As a workaround, use the guarantee internal Code assumming `boost::true_type/boost::false_type` on this will not compile. As a workaround, use the guaranteed internal
`::value` constant: `::boost::integral_constant<bool, scoped_allocator_adaptor<Allocator>::propagate_on_container_move_assignment::value>`. `::value` constant: `::boost::integral_constant<bool, scoped_allocator_adaptor<Allocator>::propagate_on_container_move_assignment::value>`.
[endsect] [endsect]

View File

@@ -995,7 +995,11 @@ class flat_tree
while(len--){ while(len--){
BidirIt next(first); BidirIt next(first);
++next; ++next;
if(next == last || val_cmp(*first, *next)){ //Use iterator_traits<BidirIt>::value_type
//because it can be different from container::value_type
//(e.g. conversion between std::pair<T1, T2> -> boost::container::pair<T1, T2>
const typename boost::container::iterator_traits<BidirIt>::value_type & val = *first;
if (next == last || val_cmp(val, *next)){
const bool room = this->m_data.m_vect.stable_emplace_back(*first); const bool room = this->m_data.m_vect.stable_emplace_back(*first);
(void)room; (void)room;
BOOST_ASSERT(room); BOOST_ASSERT(room);