boostorg / mpl

Boost.org mpl module
http://boost.org/libs/mpl
Boost Software License 1.0
51 stars 78 forks source link

Fix to Tickets #7975 and #8749 - Branched off from develop #16

Closed brunocodutra closed 9 years ago

brunocodutra commented 9 years ago

The fix is based on the report of Ticket 8749 itself:

I have traced the problem to the file boost/mpl/map/aux_/item.hpp in the class definition of m_item. m_item derives from Base (which is a map<...> type) but does not define a "typedef m_item type;" to act as a unary metafunction returning itself. The result is that Base::type is found instead which means that m_item acts as a unary metafunction returning a map with all the inserted elements removed. The class mitem at the bottom of the file properly defines a "typedef mitem type;" which strengthens my belief that it missing from m_item is a bug.

Originally Tickets 7975 and 8749 referred only to insertion of keys into maps, but the very same bug can be reproduced for sets as well. Moreover, the removal of keys from both also suffers of the same bug. This changes fix all these issues.

brunocodutra commented 9 years ago

All mpl tests were verified to pass for clang 3.6 and gcc 4.9.2 on linux and for msvc 2010 on windows xp