[Fusion] Feature Request: flat_view

I have a request for a new type of view for the fusion library: flat_view. This would operate on sequences that contain other sequences, for instance tuple<double, tuple<int, long>, pair<double, string> > and flatten them by recursively digging into the contained sequences to get all of their types. So for the example above, it's size would equal 5 and it's returned types would be double, int, long, double, string. I don't know how difficult this would be to implement, but I think it could be very useful. Joe Gottman

Joe Gottman wrote:
I have a request for a new type of view for the fusion library: flat_view. This would operate on sequences that contain other sequences, for instance tuple<double, tuple<int, long>, pair<double, string> > and flatten them by recursively digging into the contained sequences to get all of their types. So for the example above, it's size would equal 5 and it's returned types would be double, int, long, double, string. I don't know how difficult this would be to implement, but I think it could be very useful.
Yeah, it is very useful. The tricky part is the segmented iteration. Eric dealt with this sometime ago. It's very tricky, to say the least. If you'll be in Aspen, Dan Marsden's traversal lib: "A New Library for Working with Hierarchical Data Types" would also be interesting to look into. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Joe Gottman
-
Joel de Guzman