It looks like two maps with the same entries but different ordering are
considered different.
I'm trying to create a set of maps and I'm inserting two maps.
Both maps are identical but the order in which the items were inserted into
the map is different.
I was thinking that an associative sequence like set is using is_same to
compare two elements
and I tried to overload is_same -- but this did not work.
See code below or attached.
#include
#include
#include
#include
#include
#include
#include <iostream>
?
struct print
{ template<typename T>
void operator()(const T &_r) const
{ //std::cout << typeid(T).name() << "\n";
(*this)(_r, typename boost::mpl::is_sequence<T>::type());
}
template<typename T>
void operator()(const T &, const boost::mpl::true_ &) const
{ std::cout << "(\n";
boost::mpl::for_each<T>(print());
std::cout << ")\n";
}
template
void operator()(const boost::mpl::pair &, const boost::mpl::false_
&) const
{ std::cout << "pair(" << typeid(T0).name() << ", " << typeid(T1).name() <<
")" << "\n";
}
template<typename T>
void operator()(const T &, const boost::mpl::false_ &) const
{ std::cout << typeid(T).name() << "\n";
}
};
namespace boost
{
//namespace type_traits
//{
//template
//struct is_same;
?
using boost::mpl::map;
using boost::mpl::true_;
using boost::mpl::insert;
?
template
struct is_same
zero_2_one;
typedef pair<
one,
one
one_2_one;
for_each<
insert<
insert<
set<>,
insert<
insert<
map<>,
zero_2_one
::type,
one_2_one
::type
::type,
insert<
insert<
map<>,
one_2_one
::type,
zero_2_one
::type
::type
(print());
return 0;
}