[mpl][fusion] non-unique keys in map?

Hello all,
I've encountered some behaviour of maps in both fusion and mpl that I
did not expect, when inserting elements with the same key. Both
libraries behave the same.
To illustrate, I wrote the code below (full source at the end of this
post), where I create a map with a single element an then insert an
element with the same key (int_<1>). I expected the size<> of the
resulting map to be 1. Instead, the size is 2. (all on msvc9 and gcc
4.1.2 (MinGW), boost 1.35 and svn_head)
-----------------------------------
typedef pair< int_<1>, vector< int> > first_element;
typedef pair< int_<1>, vector< int, int> > second_element;
typedef map< first_element> first_map;
typedef insert< first_map, second_element>::type
second_map;
// it prints "2", I expected "1".
std::cout << size< second_map>::type() << std::endl;
-----------------------------------
Generally, when I inspect the type of the resulting map after several
inserts, I see that all inserted elements are still there.
What is wrong with the above code? What should I do if I wanted the
original entry to be replaced with the new one?
Danny.
------source-------
#include <iostream>
#include
participants (1)
-
Danny Havenith