1 // Copyright 2005 Alexander Nasonov.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/mpl/at.hpp>
7 #include <boost/mpl/lambda.hpp>
8 #include <boost/mpl/placeholders.hpp>
9 #include <boost/mpl/transform.hpp>
10 #include <boost/mpl/vector.hpp>
11 #include <boost/static_assert.hpp>
12 #include <boost/type_traits/is_same.hpp>
13 #include <boost/type_traits/promote.hpp>
15 namespace mpl = boost::mpl;
19 using namespace mpl::placeholders;
21 typedef mpl::vector< char
24 , short int const // 3
33 typedef mpl::transform< types
34 , mpl::lambda< boost::promote<_> >::type
37 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,1>::type, int >::value ));
38 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,3>::type, int const >::value ));
39 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,5>::type, int volatile >::value ));
40 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,6>::type, unsigned int >::value ));
41 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,7>::type, long >::value ));
42 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,8>::type, unsigned long >::value ));
43 BOOST_STATIC_ASSERT(( ::boost::is_same< mpl::at_c<promoted,9>::type, double const >::value ));