Boost logo

Boost :

Subject: Re: [boost] limit symbol names of fusion::vector
From: Joel de Guzman (joel_at_[hidden])
Date: 2008-11-14 19:59:47


Christian Holmquist wrote:
> Hi,
>
> I'm using
> fusion::result_of::as_vector<some_mpl_transform_view>::type
>
> quite frequently, but having troubles with extremely long type names (our
> vc8.pdb are close to 0.5 Gb).
>
> Is there any way in fusion like in mpl, where one can do
> mpl::vector<a, b, c>::type
> ^^
> which gives the shorter name
> mpl::vector3<a, b, c> instead of
> mpl::vector<a, b, c, na, na, na, ...>
>
>
> In essence, can I have fusion::vector2<int, float> from the following:
>
> fusion::result_of::as_vector<mpl::vector<int, float>::type >::type

There's actually a typedef vector_n that gives the type of the
numbered vector contained. Alas, it's private. I'm not sure if
I want to make it public. I can provide an easy solution for you:

     template <
         BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
             FUSION_MAX_VECTOR_SIZE, typename T, void_)
>
     struct make_vector_n
     {
         typedef typename detail::vector_n_chooser<
             BOOST_PP_ENUM_PARAMS(FUSION_MAX_VECTOR_SIZE, T)>::type
         type;
     };

If that works for you, would you provide simple docs for it I can
add in the reference?

> Thanks for a great lib!

Most welcome.

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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