<div dir="ltr">I guess, I've found 2 bugs. I am not sure whether I should send this 2 separate mails. It is my first time, sorry about that.<div><br></div><div>1-) Custom allocator with explicit copy constructor</div><div>Here is the non-working code: <a href="http://melpon.org/wandbox/permlink/wPpkYEzt0NrxTbJC">http://melpon.org/wandbox/permlink/wPpkYEzt0NrxTbJC</a></div><div><br></div><div>My reasoning is, in map constructor</div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">map(const allocator_type& __a)
: __tree_(__a)</pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">__a is an allocator with std::pair. However, __tree_ is instantiated with <span style="font-family:arial,sans-serif">__value_type. It requires copy construction which is explicit.</span></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap"><br></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">2-) operator=, <span style="font-family:DejaVuSansMono,"DejaVu Sans Mono",courier,monospace;font-size:12.8px;line-height:15.36px">propagate_on_container_copy_assignment</span></pre><pre style="word-wrap:break-word"><span style="color:rgb(0,0,0);white-space:pre-wrap;font-family:DejaVuSansMono,"DejaVu Sans Mono",courier,monospace;font-size:12.8px;line-height:15.36px">Code: </span><font color="#000000" face="DejaVuSansMono, DejaVu Sans Mono, courier, monospace"><span style="font-size:12.8px;line-height:15.36px;white-space:pre-wrap"><a href="http://melpon.org/wandbox/permlink/uPR3u5fYkUx2In4k">http://melpon.org/wandbox/permlink/uPR3u5fYkUx2In4k</a></span></font></pre><pre style="word-wrap:break-word"><font color="#000000" face="DejaVuSansMono, DejaVu Sans Mono, courier, monospace"><span style="font-size:12.8px;line-height:15.36px;white-space:pre-wrap">propagate_on_container_copy_assignment is true and comparison always returns false. Thus, it should use this->allocator to deallocate and other.allocator to allocate. </span></font></pre><pre style="word-wrap:break-word">Although in the example it doesn't even allocate, I guess it is because <span style="font-family:arial,sans-serif">there is </span></pre><pre style="word-wrap:break-word"><span style="font-family:arial,sans-serif">some sort of caching system, in the code it does</span></pre><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">__copy_assign_alloc(__t);
</pre><pre style="word-wrap:break-word"><span style="color:rgb(0,0,0);white-space:pre-wrap;font-family:arial,sans-serif">__assign_multi(__t.begin(), __t.end());</span><span style="font-family:arial,sans-serif"> </span></pre><pre style="word-wrap:break-word"><span style="font-family:arial,sans-serif">Then caches the nodes to be deleted in __assign_multi, but allocator already changes </span></pre><pre style="word-wrap:break-word"><span style="font-family:arial,sans-serif">in __copy_assign_alloc</span></pre><pre style="word-wrap:break-word"><span style="font-family:arial,sans-serif"><br></span></pre><pre style="word-wrap:break-word"><span style="font-family:arial,sans-serif">If they are really bugs, should I still open an issue in bugzilla or is this mail enough?</span></pre></div></div>