Changes between Initial Version and Version 1 of Ticket #10777
- Timestamp:
- Nov 9, 2014, 11:49:31 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10777
- Property Status new → assigned
-
Ticket #10777 – Description
initial v1 3 3 here is my problem: I have a stateful allocator that has a bunch of stuff inside of it. It can be move-assigned. The problem is that boost::unordered_map does this when you have propagate_on_container_move_assign typedeffed to true_type: 4 4 5 {{{ 5 6 my_alloc a; 6 7 my_alloc b; 7 8 a = std::move(b); 8 9 ASSERT(a == b); 10 }}} 9 11 10 12 That assert can obviously never be true if my_alloc is stateful, but this sequence of events currently happens in boost::unordered_map. … … 12 14 Here is an allocator that shows the problem: 13 15 16 {{{ 14 17 #pragma once 15 18 … … 119 122 std::vector<T *> available; 120 123 }; 121 124 }}} 122 125 123 126 And here is a sequence of events with which you can get it: 124 127 128 {{{ 125 129 boost::unordered_map<int, int, std::hash<int>, std::equal_to<int>, plalloc<int>> a = { { 1, 2 } }; 126 130 boost::unordered_map<int, int, std::hash<int>, std::equal_to<int>, plalloc<int>> b = { { 3, 4 } }; … … 128 132 a = std::move(b); 129 133 a = c; 134 }}}