Boost logo

Boost :

From: nee Spangenberg (dsp_at_[hidden])
Date: 2004-01-15 07:57:06


Hi Aleksey Gurtovoy,

Aleksey Gurtovoy schrieb:

> template< typename Types > struct tuple_gen
> : mpl::fold_backward<
> Types
> , boost::tuples::null_type
> , boost::tuples::cons<_2,_1>
> >
> {
> };
>
> template<
> typename T0 = boost::mpl::void_, typename T1 = boost::mpl::void_,
> typename T2 = boost::mpl::void_, typename T3 = boost::mpl::void_,
> typename T4 = boost::mpl::void_, typename T5 = boost::mpl::void_,
> typename T6 = boost::mpl::void_, typename T7 = boost::mpl::void_,
> typename T8 = boost::mpl::void_, typename T9 = boost::mpl::void_
> >
> class Test
> {
> typedef mpl::vector<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> types_;
>
> typedef typename tuple_gen<
> mpl::filter_view<
> types_
> , mpl::not_< mpl::is_void_<_1> >
> >
> >::type Tuples;
>
> Tuples m_Tuple;
> };

Great - thank you very much, Aleksey! I will try it using a newer boost lib as
which I am currently forced to use (1.30) and MSVC6, where I get the the following
error

e:\download\source\c++\boost\unpacked\boost_1_30_0\boost\mpl\aux_\preprocessed\msvc60\apply.hpp(86):
error C2039: 'apply': is not a member of 'f_<0>'

e:\download\source\c++\boost\unpacked\boost_1_30_0\boost\mpl\aux_\preprocessed\msvc60\apply.hpp(100):
see reference to class template instantiation
'boost::mpl::aux::msvc_apply2<boost::tuples::cons<boost::mpl::arg<2>,boost::mpl::arg<1>>>::re

sult_<boost::tuples::null_type,A>' being compiled

(MSVC 7 worked with 1.30, btw, but I am not allowed to use it here)

> Joel de Guzman's Fusion library (http://tinyurl.com/yvxzm) has the one that
> is about to replace the current implementation, and much more. In general,
> Fusion is definitely a must use tool if you are doing anything more than a
> very basic metaprogramming with tuples.

Thanks for that link! I really think, these are the right directions to go!

In deep dept,

Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk