1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <iostream>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/string.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/front.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/placeholders.hpp>
#include <boost/mpl/push_back.hpp>
using namespace boost;
typedef boost::mpl::vector<
boost::mpl::string<'a','b'>,
boost::mpl::string<'c','d'>,
boost::mpl::string<'e','f'>
> slist;
typedef boost::mpl::reverse_fold<
slist,
mpl::string<>,
boost::mpl::copy<mpl::_1, mpl::back_inserter<mpl::_2> >
>::type string;
int main() {
std::cout << boost::mpl::c_str<string>::value << std::endl;
} |
Partager