convert boost::mpl::vector_c<int> into const int[]

Is there any way to convert a boost::mpl::vector_c<int> into a const int[] without using boost::mpl::for_each?

on Mon Jun 15 2009, "Peter Foelsche" <peter_foelsche-AT-agilent.com> wrote:
Is there any way to convert a boost::mpl::vector_c<int> into a const int[] without using boost::mpl::for_each?
You could use a whole bunch of specializations, one for each length of vector. -- Dave Abrahams BoostPro Computing http://www.boostpro.com

David Abrahams wrote:
on Mon Jun 15 2009, "Peter Foelsche" <peter_foelsche-AT-agilent.com> wrote:
Is there any way to convert a boost::mpl::vector_c<int> into a const int[] without using boost::mpl::for_each?
You could use a whole bunch of specializations, one for each length of vector.
I did this once with preprocessor metaprogramming. It works, but be careful; depending on implementation it can be very slow (at preprocessor time). If it would help, I can probably dig out my implementation. John Bytheway
participants (3)
-
David Abrahams
-
John Bytheway
-
Peter Foelsche