//typelists.cpp

#define BOOST_MPL_USE_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_VECTOR_SIZE 20

#include <boost/mpl/vector.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/insert_range.hpp>
#include <boost/mpl/transform.hpp>
#include <boost/mpl/size.hpp>
#include <boost/variant.hpp>
#include <boost/static_assert.hpp>

using namespace std;
using namespace boost;

//this template class is used to increase the number of types
template <typename T>
struct TypeHolder {
	T held;
};

//metafunction to turn a T into TypeHolder<T>
template <typename T>
struct make_TypeHolder {
	typedef TypeHolder<T> type;
};

typedef mpl::vector<
		unsigned char,
		char,
		unsigned short,
		short,
		unsigned int,
		int,
		float,
		double
	> ScalarTypes;

//make a second vector of types, wrapping TypeHolder around them
typedef mpl::transform<ScalarTypes, mpl::lambda<make_TypeHolder<mpl::_1> >::type >::type HeldTypes;
//put the two vectors together
typedef mpl::insert_range<ScalarTypes, mpl::end<ScalarTypes>::type, HeldTypes>::type ManyTypes;
BOOST_STATIC_ASSERT((mpl::size<ManyTypes>::type::value == mpl::size<ScalarTypes>::type::value + mpl::size<HeldTypes>::type::value));
BOOST_STATIC_ASSERT((mpl::size<ManyTypes>::type::value == 16));

typedef make_variant_over<ManyTypes>::type variant_type;

int main() {
	int bob = 36;	
	variant_type v(bob);
}

