[Boost-bugs] [Boost C++ Libraries] #9931: flat_map::insert(ordered_unique_range_t...) fails with move_iterators

Subject: [Boost-bugs] [Boost C++ Libraries] #9931: flat_map::insert(ordered_unique_range_t...) fails with move_iterators
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-20 10:22:01


#9931: flat_map::insert(ordered_unique_range_t...) fails with move_iterators
------------------------------+------------------------
 Reporter: boost@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: container
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: |
------------------------------+------------------------
 This code asserts:

         flat_map<int, std::string> m1;
         m1.emplace(1, "one");
         m1.emplace(5, "five");
         m1.emplace(3, "three");

         flat_map<int, std::string> m2;
         m2.emplace(6, "six");
         m2.emplace(7, "seven");
         m2.emplace(8, "eight");

         m1.insert(
                 boost::container::ordered_unique_range_t(),
                 std::make_move_iterator(std::begin(m2)),
                 std::make_move_iterator(std::end(m2)));

         assert(m1[6] == "six"); // <- fails, m1[6] is empty

 insert() accesses the iterator multiple times, trying to determine if it
 can insert a range of values in a burst.

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