So I'm trying to get a unique list of types, and I want to get rid of all const duplicates that the list I'm passed might contain. I think the following code should work, but my_set contains "int" two times. What am i doing wrong?
#include <boost/mpl/vector.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/set.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/assert.hpp>
typedef boost::mpl::vector<float,int,float,const int>::type my_v;
typedef boost::mpl::transform
< my_v
, boost::remove_cv<boost::mpl::_1>::type
>::type my_v2;
typedef boost::mpl::fold
< my_v2
, boost::mpl::set0<>
, boost::mpl::insert
< boost::mpl::_1
, boost::mpl::_2
>
>::type my_set;
BOOST_MPL_ASSERT_RELATION( boost::mpl::size<my_set>::value, ==, 2 ); // Fails