Re: [Boost-users] [tuple] generating tuples from type lists

From: Joel de Guzman <joel@boost-consulting.com>
Maybe boost::fusion can help.
Sure:
typename boost::fusion::result_of::as_vector<your_type_list>::type
I am new to boost, so could you elaborate this a bit? I can't seem to find anything called result_of in the boost::fusion namespace. If this name is hidden by some macro magic, could you give the header file I have to #include? Else could you explain what am I missing? I was able to do something like this: #include <boost/mpl/vector.hpp> #include <boost/spirit/fusion/sequence/generate.hpp> #include <boost/spirit/fusion/sequence/make_tuple.hpp> #include <boost/utility/result_of.hpp> using namespace boost::mpl; using namespace boost::fusion; using namespace boost; typedef vector<int, char, double>::type typelist; typedef meta::generate<typelist>::type my_tuple; int main() { my_tuple t; t = make_tuple(1, 'a', 0.25); } But I have the feeling this might not be the intended way of usage ... Regards ImRe

imre@u-tx.com wrote:
From: Joel de Guzman <joel@boost-consulting.com>
Maybe boost::fusion can help. Sure:
typename boost::fusion::result_of::as_vector<your_type_list>::type
I am new to boost, so could you elaborate this a bit?
I can't seem to find anything called result_of in the boost::fusion namespace. If this name is hidden by some macro magic, could you give the header file I have to #include? Else could you explain what am I missing?
I was able to do something like this:
[snip code]
But I have the feeling this might not be the intended way of usage ...
Oh. You are looking at Fusion1. That was the pre-review version. We now have Fusion2 (which I will put in the CVS soon) which is the review version. Sorry for the confusion. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
imre@u-tx.com
-
Joel de Guzman