[Fusion] as_map regression?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Fusion] as_map regression?

Frank Neuhaus-2
Hi,

I recently updated from boost 1.54 to boost 1.56 and started noticing a different behavior in the as_map metafunction in the new version.
The problem occurs when converting a boost fusion set to a fusion map using the as_map metafunction:

typedef boost::fusion::set<boost::fusion::pair<int,int>, boost::fusion::pair<double,int> > myset;
typedef typename boost::fusion::result_of::as_map<myset>::type mymap;

This results in mymap being equal to: 

boost::fusion::map<boost::fusion::pair<boost::fusion::pair<int, int>, boost::fusion::pair<int, int> >, boost::fusion::pair<boost::fusion::pair<double, int>, boost::fusion::pair<double, int> > >

while I would expect it to be equal to:

boost::fusion::map<boost::fusion::pair<int, int>, boost::fusion::pair<double, int> >

In my application, this causes a bunch of errors when subsequently calling the (non-meta) at_key function, as the type of the map is incorrect.
I have provided a full example at:


The example compiles fine in 1.54 while failing in 1.56. I have also provided a workaround, for 1.56, which first converts the set to a vector.

Is the change intended, i.e. is it not allowed to convert a set of pairs to a map, or is it an unintended regression?

Thanks,
   Frank

------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general