]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/mpl/example/tuple_from_list.cpp
2 // Copyright Aleksey Gurtovoy 2002-2004
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org/libs/mpl for documentation.
14 #include <boost/mpl/reverse_fold.hpp>
15 #include <boost/mpl/list.hpp>
16 #include <boost/tuple/tuple.hpp>
20 using namespace boost::mpl
;
22 template< typename Types
> struct tuple_gen
25 , boost::tuples::null_type
26 , boost::tuples::cons
<_2
,_1
>
33 tuple_gen
< list
<int,char const*,bool> >::type t
;
35 boost::get
<0>(t
) = -1;
36 boost::get
<1>(t
) = "text";
37 boost::get
<2>(t
) = false;
40 << boost::get
<0>(t
) << '\n'
41 << boost::get
<1>(t
) << '\n'
42 << boost::get
<2>(t
) << '\n'