
Hello, I am having problems getting fusion sequences to work with MPL. The docs indicate this should be possible , e.g. the "Adapted" page states, "Fusion sequences may also be adapted as fully conforming MPL sequences (see Intrinsics)." I couldn't find more information on the Intrinsics page regarding the use of fusion sequences with MPL, but I tried: #include <boost/mpl/is_sequence.hpp> #include <boost/fusion/container/vector.hpp> #include <boost/fusion/sequence/intrinsic.hpp> int main() { BOOST_MPL_ASSERT(( boost::mpl::is_sequence<fusion::vector<int> > )); } And got a mess of errors from mpl::is_sequence<fusion::vector<int> >: (gcc 4.0.1/darwin) /Development/boost/boost/mpl/begin_end.hpp: In instantiation of 'boost::mpl::begin<boost::fusion::vector<int, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_, boost::fusion::void_> >': [snip errors] /Development/boost/boost/mpl/begin_end.hpp:35: error: invalid use of undefined type 'struct boost::mpl::begin_impl<boost::fusion::fusion_sequence_tag>' [...more errors] I tried things other than is_sequence (like mpl::at), but got similar errors. What am I missing? Thanks for any suggestions! Stjepan

Stjepan Rajko wrote:
Hello,
I am having problems getting fusion sequences to work with MPL. The docs indicate this should be possible , e.g. the "Adapted" page states,
"Fusion sequences may also be adapted as fully conforming MPL sequences (see Intrinsics)." I couldn't find more information on the Intrinsics page regarding the use of fusion sequences with MPL, but I tried:
#include <boost/mpl/is_sequence.hpp> #include <boost/fusion/container/vector.hpp> #include <boost/fusion/sequence/intrinsic.hpp>
int main() { BOOST_MPL_ASSERT(( boost::mpl::is_sequence<fusion::vector<int> > )); }
Try: #include <boost/mpl/is_sequence.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/include/mpl.hpp> int main() { BOOST_MPL_ASSERT(( boost::mpl::is_sequence<boost::fusion::vector<int> > )); } mpl.hpp does the mapping (BTW. Not really relevant, but, there's a nifty flat "include" directory where you can find all the includes which forwards to all modules. Like MPL flat include structure.) HTH. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

On Nov 29, 2007 5:50 PM, Joel de Guzman <joel@boost-consulting.com> wrote:
Try:
#include <boost/mpl/is_sequence.hpp> #include <boost/fusion/include/vector.hpp> #include <boost/fusion/include/mpl.hpp>
int main() { BOOST_MPL_ASSERT(( boost::mpl::is_sequence<boost::fusion::vector<int> > )); }
mpl.hpp does the mapping
That did it! Thanks for the quick reply!
(BTW. Not really relevant, but, there's a nifty flat "include" directory where you can find all the includes which forwards to all modules. Like MPL flat include structure.)
I've noticed, and it's very helpful - thanks for adding that in! (although I have to say the old include file layout definitely gave me an appreciation for fusion's beautiful structure :-)) Stjepan

Stjepan Rajko wrote:
On Nov 29, 2007 5:50 PM, Joel de Guzman <joel@boost-consulting.com> wrote:
Try:
I've noticed, and it's very helpful - thanks for adding that in! (although I have to say the old include file layout definitely gave me an appreciation for fusion's beautiful structure :-))
Thanks! It's still there when you want it that way. It's still documented. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net

(BTW. Not really relevant, but, there's a nifty flat "include"
directory
where you can find all the includes which forwards to all modules. Like MPL flat include structure.)
HTH.
Regards, -- Joel de Guzman
Cool, but the include folder did not link to the proper header in one file on svn HEAD. Index: accumulate.hpp =================================================================== --- accumulate.hpp (revision 41469) +++ accumulate.hpp (working copy) @@ -7,6 +7,6 @@ #if !defined(FUSION_INCLUDE_ACCUMULATE) #define FUSION_INCLUDE_ACCUMULATE -#include <boost/fusion/algorithm/accumulate.hpp> +#include <boost/fusion/algorithm/iteration/accumulate.hpp> #endif

John Femiani wrote:
(BTW. Not really relevant, but, there's a nifty flat "include" directory where you can find all the includes which forwards to all modules. Like MPL flat include structure.)
Cool, but the include folder did not link to the proper header in one file on svn HEAD.
Oops. Thanks for spotting that. Fixed. Cheers, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (3)
-
Joel de Guzman
-
John Femiani
-
Stjepan Rajko