binary mpl::transform fails to compile with fusion::vector

I am hoping someone can point me the in right direction regarding this
code snippit failing to compile. My suspicion is that it is a header
problem but any help would be appreciated.
In short, I seem to be missing why the binary form of mpl::transform
won't work with fusion::vector. (unary form works just fine).
The code below just attempts to make a std::pair<> from the contents of
two sequences (this is just an example to illustrate the transform
problem). If the two sequences are mpl::vectors, everything is fine. If
they are fusion::vectors then 'lots of errors'.
I'm fairly new to both mpl and fusion so I am not ruling out the fact that
I have done something stupid.
Thanks in advance,
Mike
See code below.
#include

Mike Tegtmeyer wrote:
I am hoping someone can point me the in right direction regarding this code snippit failing to compile. My suspicion is that it is a header problem but any help would be appreciated.
In short, I seem to be missing why the binary form of mpl::transform won't work with fusion::vector. (unary form works just fine).
The code below just attempts to make a std::pair<> from the contents of two sequences (this is just an example to illustrate the transform problem). If the two sequences are mpl::vectors, everything is fine. If they are fusion::vectors then 'lots of errors'.
I'm fairly new to both mpl and fusion so I am not ruling out the fact that I have done something stupid.
Trying the code, it seems mpl::(binary)transform is looking for Seq::tag which is not a requirement for MPL::Forward Sequence which mpl::transform requires (http://tinyurl.com/l6kcb4). fusion::vector adheres fully to an MPL::Forward Sequence. I'm guessing this is an MPL problem, but I may be wrong, so I'll leave it to the better hands of Aleksey. Aleksey, can you help? Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

On Wed, 17 Jun 2009 12:07:33 -0500, Joel de Guzman
Mike Tegtmeyer wrote:
I am hoping someone can point me the in right direction regarding this code snippit failing to compile. My suspicion is that it is a header problem but any help would be appreciated. In short, I seem to be missing why the binary form of mpl::transform won't work with fusion::vector. (unary form works just fine). The code below just attempts to make a std::pair<> from the contents of two sequences (this is just an example to illustrate the transform problem). If the two sequences are mpl::vectors, everything is fine. If they are fusion::vectors then 'lots of errors'. I'm fairly new to both mpl and fusion so I am not ruling out the fact that I have done something stupid.
Trying the code, it seems mpl::(binary)transform is looking for Seq::tag which is not a requirement for MPL::Forward Sequence which mpl::transform requires (http://tinyurl.com/l6kcb4). fusion::vector adheres fully to an MPL::Forward Sequence.
No, the error is caused by the following code in MPL's pair_view
(which is the underlying implementation mechanism for the binary
transform):
typedef typename min<
typename iterator_category

Aleksey Gurtovoy wrote:
No, the error is caused by the following code in MPL's pair_view (which is the underlying implementation mechanism for the binary transform):
typedef typename min< typename iterator_category
::type , typename iterator_category ::type >::type category_; That is, as per iterator_category's requirements [1], pair_view assumes that the iterator_category's result would be model of MPL's Integral Constant, which does not seem to be the case with Fusion categories.
[1] http://www.boost.org/doc/libs/1_39_0/libs/mpl/doc/refmanual/iterator-categor...
I see. It's a fusion bug then. I'll see what I can do. In the meantime, may I request the OP to add a trac ticket entry for this? Thank you, Aleksey! Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net

Done. Ticket #3204 Thanks for the help. Mike On Mon, 22 Jun 2009, Joel de Guzman wrote:
Aleksey Gurtovoy wrote:
No, the error is caused by the following code in MPL's pair_view (which is the underlying implementation mechanism for the binary transform):
typedef typename min< typename iterator_category
::type , typename iterator_category ::type >::type category_; That is, as per iterator_category's requirements [1], pair_view assumes that the iterator_category's result would be model of MPL's Integral Constant, which does not seem to be the case with Fusion categories.
[1] http://www.boost.org/doc/libs/1_39_0/libs/mpl/doc/refmanual/iterator-categor...
I see. It's a fusion bug then. I'll see what I can do. In the meantime, may I request the OP to add a trac ticket entry for this?
Thank you, Aleksey!
Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Aleksey Gurtovoy
-
Joel de Guzman
-
Mike Tegtmeyer