Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#2042 closed Bugs (fixed)

map insert does not work after an erase in the non-typeof implementation

Reported by: Steven Watanabe Owned by: Aleksey Gurtovoy
Milestone: Boost 1.40.0 Component: mpl
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc:

Description

This test case fails.

#include <boost/mpl/map.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/erase_key.hpp>
#include <boost/mpl/at.hpp>
#include <boost/type_traits/is_same.hpp>

using namespace boost::mpl;

typedef erase_key<
  insert<
    insert<map0<>, pair<char, double> >::type,
    pair<int, float>
  >::type,
  char
>::type int_to_float_map;

typedef insert<int_to_float_map, pair<char, long> >::type with_char_too;

BOOST_MPL_ASSERT((boost::is_same<at<with_char_too, char>::type, long>));

The attached patch fixes the problem.

Attachments (1)

insert_impl.hpp.patch (464 bytes ) - added by Steven Watanabe 14 years ago.

Download all attachments as: .zip

Change History (4)

by Steven Watanabe, 14 years ago

Attachment: insert_impl.hpp.patch added

comment:1 by Steven Watanabe, 14 years ago

Component: Nonempl
Owner: set to Aleksey Gurtovoy

comment:2 by Steven Watanabe, 13 years ago

Resolution: fixed
Status: newclosed

(In [55727]) Use order instead of size to find the next order in the non-typeof implementation of mpl::insert for mpl::map. Fixes #2042.

comment:3 by Aleksey Gurtovoy, 13 years ago

Milestone: Boost 1.36.0Boost 1.40.0
Note: See TracTickets for help on using tickets.