limit symbol names of fusion::vector

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 Thanks for a great lib! / Christian

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

AMDG Joel de Guzman wrote:
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?
Is there a particular reason why make_vector doesn't use this. In Christ, Steven Watanabe

Steven Watanabe wrote:
AMDG
Joel de Guzman wrote:
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?
Is there a particular reason why make_vector doesn't use this.
Good point. I'll ponder on this and get back to you. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Joel de Guzman wrote:
Steven Watanabe wrote:
AMDG
Joel de Guzman wrote:
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?
Is there a particular reason why make_vector doesn't use this.
Good point. I'll ponder on this and get back to you.
Ok, it's looking good. I updated make_vector to return the numbered forms. All tests are passing. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Christian Holmquist wrote:
In essence, can I have fusion::vector2<int, float> from the following:
fusion::result_of::as_vector<mpl::vector<int, float>::type >::type
Ok, I also changed as_vector to return the numbered forms. All tests are passing. I think this is a good move as it will lessen the number of template instantiations (should make compile times faster). So, now: 1) as_vector returns vectorN 2) make_vector returns vectorN Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

2008/11/15 Joel de Guzman <joel@boost-consulting.com>
Christian Holmquist wrote:
In essence, can I have fusion::vector2<int, float> from the following:
fusion::result_of::as_vector<mpl::vector<int, float>::type >::type
Ok, I also changed as_vector to return the numbered forms. All tests are passing. I think this is a good move as it will lessen the number of template instantiations (should make compile times faster). So, now:
1) as_vector returns vectorN 2) make_vector returns vectorN
I've tested by copying detail/as_vector.hpp to boost 1.35 and everything seem to work; it removed by itself 15% of the .pdb file in the project tested. Compile times seemed to improve as well but I've got no hard numbers on this (we use a distributed compiler system, so time depends on amount of machines allocated to me). Much appreciated! / Christian
participants (3)
-
Christian Holmquist
-
Joel de Guzman
-
Steven Watanabe